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");
20
this.last_parameters = "";
23
filter_set_callbacks(this);
28
FILTER.prototype.HasSearch = function()
30
return this.search != "" && this.search != undefined;
33
FILTER.prototype.OnSelect = function(id)
35
//if (!this.HasSearch()) {
36
// this.last_selected = id;
38
var props = "kdb_run=&kdb_date=" + id + "&kdb_search=" + this.search + "&kdb_parameters=" + this.parameters + "&kdb_window=" + this.window + "&kdb_page=1";
39
adei.SetCustomProperties(props);
42
FILTER.prototype.AfterLoad = function()
44
if (this.HasSearch()) {
45
this.dates.selectItem("all", true, false);
48
//this.dates.selectItem(this.last_selected, true, false);
50
var index = this.dates.hasChildren("all") - 1;
52
var id = this.dates.getItemIdByIndex("all", index);
53
this.dates.openItem(id);
55
index = this.dates.hasChildren(id) - 1;
56
id = this.dates.getItemIdByIndex(id, index);
57
this.dates.openItem(id);
59
index = this.dates.hasChildren(id) - 1;
60
id = this.dates.getItemIdByIndex(id, index);
61
this.dates.selectItem(id, true, false);
66
FILTER.prototype.SetSearch = function(search, parameters, window)
68
var input = document.getElementById("parameters");
69
this.parameters = parameters;
70
var value = parameters;
71
input.value = decodeURIComponent(value);
73
if (search == this.search && parameters == this.last_parameters && window == this.window) {
74
var selected = this.dates.getSelectedItemId();
75
var props = "kdb_date=" + selected + "&kdb_search=" + search + "&kdb_parameters=" + this.parameters + "&kdb_window=" + this.window;
76
katrin.SetCustomProperties(props);
81
this.last_parameters = parameters;
87
FILTER.prototype.Update = function()
89
this.dates.deleteChildItems(0);
90
var props = "target=dates&kdb_search=" + this.search + "&kdb_parameters=" + this.last_parameters + "&kdb_window=" + this.window;
91
this.dates.loadXML(adei.GetURL("setups/katrin/services/adei.fcgi", props), this.after_load);
94
FILTER.prototype.SetParameters = function(parameters)
98
FILTER.prototype.ApplyParameters = function()
100
var input = document.getElementById("parameters");
101
this.parameters = encodeURIComponent(input.value);
102
katrin.SetCustomProperties("kdb_date=&kdb_run=&kdb_parameters=" + this.parameters);
105
FILTER.prototype.FocusParameters = function()
107
var input = document.getElementById("parameters");
109
if (input.value == "help") {
113
adei.OpenControl("filter");
118
FILTER.prototype.ClearParameters = function()
120
var input = document.getElementById("parameters");
122
this.ApplyParameters();