From: phasefx Date: Tue, 3 Nov 2009 22:38:15 +0000 (+0000) Subject: toward easier row refreshing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2c5a889891cd1d0393ac6f3fe327452b57cb3d68;p=contrib%2FConifer.git toward easier row refreshing git-svn-id: svn://svn.open-ils.org/ILS/trunk@14753 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 1d95c4e4dc..59290276ab 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -7,6 +7,8 @@ util.list = function (id) { 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 @@ util.list.prototype = { 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 @@ util.list.prototype = { // 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 @@ util.list.prototype = { 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');