var obj = this;
obj.scratch_data = {};
+ obj.event_listeners = new EventListenerList();
// If set, save and restore columns as if the tree/list id was the value of columns_saved_under
obj.columns_saved_under = params.columns_saved_under;
treecols.appendChild(treecol);
if (this.columns[i].type == 'checkbox') {
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'click',
function(ev) {
setTimeout(
false
);
} else {
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'sort_first_asc',
function(ev) {
dump('sort_first_asc\n');
},
false
);
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'sort_first_desc',
function(ev) {
dump('sort_first_desc\n');
},
false
);
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'sort_next_asc',
function(ev) {
dump('sort_next_asc\n');
},
false
);
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'sort_next_desc',
function(ev) {
dump('sort_next_desc\n');
false
);
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'click',
function(ev) {
if (ev.button == 2 /* context menu click */ || ev.target.getAttribute('no_sort')) {
false
);
- treecol.addEventListener(
+ obj.event_listeners.add(
+ treecol,
'sort',
function(ev) {
if (!obj.first_sort) {
if (typeof params.on_checkbox_toggle == 'function') {
this.on_checkbox_toggle = params.on_checkbox_toggle;
}
- this.node.addEventListener(
+ obj.event_listeners.add(
+ this.node,
'select',
function(ev) {
if (typeof params.on_select == 'function') {
false
);
if (typeof params.on_click == 'function') {
- this.node.addEventListener(
+ obj.event_listeners.add(
+ this.node,
'click',
params.on_click,
false
);
}
if (typeof params.on_dblclick == 'function') {
- this.node.addEventListener(
+ obj.event_listeners.add(
+ this.node,
'dblclick',
params.on_dblclick,
false
}
/*
- this.node.addEventListener(
+ obj.event_listeners.add(
+ this.node,
'mousemove',
function(ev) { obj.detect_visible(); },
false
);
*/
- this.node.addEventListener(
+ obj.event_listeners.add(
+ this.node,
'keypress',
function(ev) { obj.auto_retrieve(); },
false
);
- this.node.addEventListener(
+ obj.event_listeners.add(
+ this.node,
'click',
function(ev) { obj.auto_retrieve(); },
false
);
- window.addEventListener(
+ obj.event_listeners.add(
+ window,
'resize',
function(ev) { obj.auto_retrieve(); },
false
slider.addEventListener('command',function(){alert('slider command');},false);
slider.addEventListener('scroll',function(){alert('slider scroll');},false);
*/
- this.node.addEventListener('scroll',function(){ obj.auto_retrieve(); },false);
+ obj.event_listeners.add(this.node, 'scroll',function(){ obj.auto_retrieve(); },false);
this.restores_columns(params);
},
}
},
+ 'cleanup' : function () {
+ var obj = this;
+ obj.event_listeners.removeAll();
+ },
+
'save_columns' : function (params) {
var obj = this;
if (obj.data.hash.aous['gui.disable_local_save_columns']) {
obj.put_retrieving_label(treerow);
if (typeof params.retrieve_row == 'function' || typeof this.retrieve_row == 'function') {
- treerow.addEventListener(
+ obj.event_listeners.add(
+ treerow,
'flesh',
function() {
}
}
} else {
- treerow.addEventListener(
+ obj.event_listeners.add(
+ treerow,
'flesh',
function() {
//dump('fleshing anon\n');
s += 'found a retrieve_row function\n';
- treerow.addEventListener(
+ obj.event_listeners.add(
+ treerow,
'flesh',
function() {
s += 'did not find a retrieve_row function\n';
- treerow.addEventListener(
+ obj.event_listeners.add(
+ treerow,
'flesh',
function() {
//dump('fleshing anon\n');
try {
var x = document.getElementById(obj.node.id + '_clipfield');
if (x) {
- x.addEventListener(
+ obj.event_listeners.add(
+ x,
'command',
function() {
obj.clipboard(params);
}
x = document.getElementById(obj.node.id + '_csv_to_clipboard');
if (x) {
- x.addEventListener(
+ obj.event_listeners.add(
+ x,
'command',
function() {
obj.dump_csv_to_clipboard(params);
}
x = document.getElementById(obj.node.id + '_csv_to_printer');
if (x) {
- x.addEventListener(
+ obj.event_listeners.add(
+ x,
'command',
function() {
obj.dump_csv_to_printer(params);
}
x = document.getElementById(obj.node.id + '_extended_to_printer');
if (x) {
- x.addEventListener(
+ obj.event_listeners.add(
+ x,
'command',
function() {
obj.dump_extended_format_to_printer(params);
x = document.getElementById(obj.node.id + '_csv_to_file');
if (x) {
- x.addEventListener(
+ obj.event_listeners.add(
+ x,
'command',
function() {
obj.dump_csv_to_file(params);
}
x = document.getElementById(obj.node.id + '_save_columns');
if (x) {
- x.addEventListener(
+ obj.event_listeners.add(
+ x,
'command',
function() {
obj.save_columns(params);