From: phasefx Date: Mon, 8 Oct 2007 20:48:46 +0000 (+0000) Subject: handle copy status list refresh if the barcode for a row changes.. need to test the... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=22efbad247a2b9c2129febe825965d3ef5b88505;p=Evergreen.git handle copy status list refresh if the barcode for a row changes.. need to test the list.js changes for regressions in other interfaces git-svn-id: svn://svn.open-ils.org/ILS/trunk@7873 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 42106be912..41bc97a972 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -429,7 +429,7 @@ util.list.prototype = { // if current row is selected, send another select event to re-sync data that the client code fetches on selects if ( obj.node.view.selection.isSelected( idx ) ) { dump('dispatching select event for on_retrieve for idx = ' + idx + '\n'); - util.widgets.dispatch('select',params.row_node); + util.widgets.dispatch('select',obj.node); } } catch(E) { alert('fixme2: ' + E); @@ -579,7 +579,7 @@ util.list.prototype = { // if current row is selected, send another select event to re-sync data that the client code fetches on selects if ( obj.node.view.selection.isSelected( idx ) ) { dump('dispatching select event for on_retrieve for idx = ' + idx + '\n'); - util.widgets.dispatch('select',params.row_node); + util.widgets.dispatch('select',obj.node); } } catch(E) { alert('fixme2: ' + E); @@ -653,6 +653,8 @@ util.list.prototype = { setTimeout( function() { obj.auto_retrieve(); }, 0 ); + JSAN.use('util.widgets'); util.widgets.dispatch('select',obj.node); + return params; }, @@ -811,7 +813,7 @@ util.list.prototype = { params.row = row; obj._map_row_to_listcell(params,listitem); obj.node.appendChild( listitem ); - util.widgets.dispatch('select',params.row_node); + util.widgets.dispatch('select',obj.node); } if (typeof params.retrieve_row == 'function') { diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index b08c9f076e..1d74c7d898 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -13,7 +13,7 @@ circ.copy_status = function (params) { circ.copy_status.prototype = { 'selection_list' : [], - 'list_barcode_map' : {}, + 'list_copyid_map' : {}, 'init' : function( params ) { @@ -1025,15 +1025,23 @@ circ.copy_status.prototype = { if (!refresh) { var nparams = obj.list.append(params); if (!document.getElementById('trim_list').checked) { - if (typeof obj.list_barcode_map[barcode] == 'undefined') obj.list_barcode_map[barcode] =[]; - obj.list_barcode_map[barcode].push(nparams); + if (typeof obj.list_copyid_map[details.copy.id()] == 'undefined') obj.list_copyid_map[details.copy.id()] =[]; + obj.list_copyid_map[details.copy.id()].push(nparams); } } else { if (!document.getElementById('trim_list').checked) { - for (var i = 0; i < obj.list_barcode_map[barcode].length; i++) { - params.my_node = obj.list_barcode_map[barcode][i].my_node; - obj.list.refresh_row(params); - } + if (typeof obj.list_copyid_map[details.copy.id()] != 'undefined') { + for (var i = 0; i < obj.list_copyid_map[details.copy.id()].length; i++) { + if (typeof obj.list_copyid_map[details.copy.id()][i] == 'undefined') { + obj.list.append(params); + } else { + params.my_node = obj.list_copyid_map[details.copy.id()][i].my_node; + obj.list.refresh_row(params); + } + } + } else { + obj.list.append(params); + } } else { obj.list.append(params); }