1
function filter_set_callbacks(filter)
3
filter.after_load = function() {filter.AfterLoad();};
4
filter.dates.attachEvent("onSelect", function(id) {filter.OnSelect(id);});
7
function FILTER(id, control)
9
//this.last_selected = 0;
11
this.dates = new dhtmlXTreeObject(id, "100%", "100%", 0);
12
this.dates.enableTreeLines(true);
13
if (adei.cfg.dhtmlx_iconset) {
14
this.dates.setImagePath(adei.cfg.dhtmlx_iconset);
16
this.dates.setDataMode("xml");
18
filter_set_callbacks(this);
21
FILTER.prototype.HasSearch = function()
23
return this.search != "" && this.search != undefined;
26
FILTER.prototype.OnSelect = function(id)
28
//if (!this.HasSearch()) {
29
// this.last_selected = id;
31
adei.SetCustomProperties("kdb_page=1&kdb_date=" + id);
34
FILTER.prototype.AfterLoad = function()
36
if (this.HasSearch()) {
37
this.dates.selectItem("all", true, false);
40
//this.dates.selectItem(this.last_selected, true, false);
42
var index = this.dates.hasChildren("all") - 1;
44
var id = this.dates.getItemIdByIndex("all", index);
45
this.dates.openItem(id);
47
index = this.dates.hasChildren(id) - 1;
48
id = this.dates.getItemIdByIndex(id, index);
49
this.dates.openItem(id);
51
index = this.dates.hasChildren(id) - 1;
52
id = this.dates.getItemIdByIndex(id, index);
53
this.dates.selectItem(id, true, false);
58
FILTER.prototype.SetSearch = function(search)
60
if (search == this.search) {
61
var selected = this.dates.getSelectedItemId();
62
katrin.SetCustomProperties("kdb_date=" + selected);
67
this.dates.deleteChildItems(0);
69
var props = "target=dates&kdb_search=" + this.search;
70
this.dates.loadXML(adei.GetServiceURL("katrin", props), this.after_load);
73
FILTER.prototype.SetParameters = function(parameters)