From 0b146044ba46ac0235113f7537abbd8ce3734bf7 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 13 Oct 2009 05:23:48 +0000 Subject: [PATCH] Support some extra callback functions for staff client lists (on_sort and on_checkbox_toggle) git-svn-id: svn://svn.open-ils.org/ILS/trunk@14394 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/util/list.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 936b0fcd84..bc6b425331 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -111,6 +111,12 @@ util.list.prototype = { this.node.appendChild(treechildren); this.treechildren = treechildren; } + if (typeof params.on_sort == 'function') { + this.on_sort = params.on_sort; + } + if (typeof params.on_checkbox_toggle == 'function') { + this.on_checkbox_toggle = params.on_checkbox_toggle; + } this.node.addEventListener( 'select', function(ev) { @@ -1318,6 +1324,7 @@ util.list.prototype = { for (var i = 0; i < rows.length; i++) { obj.treechildren.appendChild( rows[i].node ); } + if (typeof obj.on_sort == 'function') obj.on_sort(); } catch(E) { obj.error.standard_unexpected_error_alert('sorting',E); } @@ -1345,6 +1352,7 @@ util.list.prototype = { var treecell = treerow.childNodes[ col_pos ]; treecell.setAttribute('value',(toggle == 'on')); } + if (typeof obj.on_checkbox_toggle == 'function') obj.on_checkbox_toggle(toggle); } catch(E) { obj.error.standard_unexpected_error_alert('pre toggle', E); } -- 2.11.0