[open-ils-commits] r14753 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 3 17:38:21 EST 2009


Author: phasefx
Date: 2009-11-03 17:38:15 -0500 (Tue, 03 Nov 2009)
New Revision: 14753

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
Log:
toward easier row refreshing

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2009-11-03 21:50:04 UTC (rev 14752)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2009-11-03 22:38:15 UTC (rev 14753)
@@ -7,6 +7,8 @@
 
     this.row_count = { 'total' : 0, 'fleshed' : 0 };
 
+    this.unique_row_counter = 0;
+
     if (!this.node) throw('Could not find element ' + id);
     switch(this.node.nodeName) {
         case 'listbox' : 
@@ -334,6 +336,11 @@
         if (this.row_count.fleshed == this.row_count.total) {
             setTimeout( function() { obj.exec_on_all_fleshed(); }, 0 );
         }
+        rparams.my_node.setAttribute('unique_row_counter',obj.unique_row_counter);
+        rparams.unique_row_counter = obj.unique_row_counter++;
+        if (typeof params.on_append == 'function') {
+            params.on_append(rparams);
+        }
         return rparams;
     },
     
@@ -513,8 +520,10 @@
                     // Remove oldest row
                     //if (typeof params.to_bottom != 'undefined') 
                     if (typeof params.to_top == 'undefined') {
+                        if (typeof params.on_delete == 'function') { prams.on_delete( treechildren_node.firstChild.getAttribute('unique_row_counter') ); }
                         treechildren_node.removeChild( treechildren_node.firstChild );
                     } else {
+                        if (typeof params.on_delete == 'function') { prams.on_delete( treechildren_node.lastChild.getAttribute('unique_row_counter') ); }
                         treechildren_node.removeChild( treechildren_node.lastChild );
                     }
                 }
@@ -560,6 +569,7 @@
         var treerow = document.createElement('treerow');
         treeitem.appendChild( treerow );
         treerow.setAttribute('retrieve_id',params.retrieve_id);
+        if (params.row_properties) treerow.setAttribute('properties',params.row_properties);
 
         s += ('tree = ' + this.node.nodeName + '\n');
         s += ('treeitem = ' + treeitem.nodeName + '  treerow = ' + treerow.nodeName + '\n');



More information about the open-ils-commits mailing list