Support some extra callback functions for staff client lists (on_sort and on_checkbox...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Oct 2009 05:23:48 +0000 (05:23 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Oct 2009 05:23:48 +0000 (05:23 +0000)
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

index 936b0fc..bc6b425 100644 (file)
@@ -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);
         }