From 6274d9745c69624ff9e5a00583923c34e220e879 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 27 Dec 2005 11:24:49 +0000 Subject: [PATCH] retrieve_row for util.list is responsible for calling on_retrieve to finish mapping the row to the columns. This means retrieve_row can fire an async request and have on_retrieve handle the fleshing of the row git-svn-id: svn://svn.open-ils.org/ILS/trunk@2530 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/evergreen/util/list.js | 20 ++++++++++++++----- .../xul/staff_client/server/patron/holds.js | 3 +++ .../server/patron/search_result.js | 4 +++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/evergreen/util/list.js b/Open-ILS/xul/staff_client/chrome/content/evergreen/util/list.js index 7f0caf3d14..0e77634d7f 100644 --- a/Open-ILS/xul/staff_client/chrome/content/evergreen/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/evergreen/util/list.js @@ -133,6 +133,13 @@ util.list.prototype = { treerow.setAttribute('retrieve_id',params.retrieve_id); //FIXME//Make async and fire when row is visible in list var row; + + params.row_node = treeitem; + params.on_retrieve = function(row) { + params.row = row; + obj._map_row_to_treecell(params,treerow); + } + if (typeof params.retrieve_row == 'function') { row = params.retrieve_row( params ); @@ -145,8 +152,6 @@ util.list.prototype = { } } - params.row = row; - obj._map_row_to_treecell(params,treerow); }, 0 ); } else { @@ -176,6 +181,14 @@ util.list.prototype = { listitem.setAttribute('retrieve_id',params.retrieve_id); //FIXME//Make async and fire when row is visible in list var row; + + params.row_node = listitem; + params.on_retrieve = function(row) { + params.row = row; + obj._map_row_to_treecell(params,treerow); + obj.node.appendChild( listitem ); + } + if (typeof params.retrieve_row == 'function') { row = params.retrieve_row( params ); @@ -188,9 +201,6 @@ util.list.prototype = { } } - params.row = row; - obj._map_row_to_listcell(params,listitem); - obj.node.appendChild( listitem ); }, 0 ); } else { diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index 054378abab..d364d0b0f5 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -55,6 +55,9 @@ patron.holds.prototype = { } catch(E) { obj.error.sdump('D_ERROR','retrieve_row: ' + E ); } + if (typeof params.on_retrieve == 'function') { + params.on_retrieve(row); + } return row; } } diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 62a7b49bf5..560efd694e 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -45,7 +45,9 @@ patron.search_result.prototype = { var row = params.row; if (typeof row.my == 'undefined') row.my = {}; row.my.au = au_obj; - + if (typeof params.on_retrieve == 'function') { + params.on_retrieve(row); + } return row; }, 'on_select' : function(ev) { -- 2.43.2