From c7031b1758f96e8e343c747c24a3b15f2c018591 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 19 Dec 2005 15:20:26 +0000 Subject: [PATCH 1/1] Yay! Inserting an empty listitem into a listbox gives us the magic column we hate. So insert a listitem with other elements already attached instead git-svn-id: svn://svn.open-ils.org/ILS/trunk@2441 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/evergreen/util/list.js | 4 +++- .../xul/staff_client/server/patron/bills.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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 059ea32db3..61a5c861ab 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 @@ -144,7 +144,6 @@ util.list.prototype = { var s = ('util.list.append: params = ' + js2JSON(params) + '\n'); var listitem = document.createElement('listitem'); - this.node.appendChild( listitem ); s += ('listbox = ' + this.node + ' listitem = ' + listitem + '\n'); @@ -171,6 +170,9 @@ util.list.prototype = { } else { this._map_row_to_listcell(params,listitem); } + + this.node.appendChild( listitem ); + this.error.sdump('D_LIST',s); return listitem; diff --git a/Open-ILS/xul/staff_client/server/patron/bills.js b/Open-ILS/xul/staff_client/server/patron/bills.js index 66ad2c32fd..11aeee6a8f 100644 --- a/Open-ILS/xul/staff_client/server/patron/bills.js +++ b/Open-ILS/xul/staff_client/server/patron/bills.js @@ -25,10 +25,12 @@ patron.bills.prototype = { obj.list.init( { 'columns' : [ + /* { 'id' : 'checkbox', 'label' : '', 'flex' : 1, 'primary' : false, 'hidden' : false, 'render' : 'document.createElement("checkbox")' }, + */ { 'id' : 'xact_dates', 'label' : getString('staff.bills_xact_dates_label'), 'flex' : 1, 'primary' : false, 'hidden' : false, 'render' : 'xact_dates_box(my.mbts)' @@ -160,6 +162,12 @@ patron.bills.prototype = { } ); + obj.retrieve(); + + //FIXME//.bills virtual field + for (var i = 0; i < obj.bills.length; i++) { + obj.list.append( { 'row' : { 'mobts' : obj.bills[i] } } ); + } }, 'apply_payment' : function() { @@ -261,6 +269,15 @@ patron.bills.prototype = { } tb.value = util.money.cents_as_dollars( proposed_change ); obj.controller.view.bill_credit_amount.value = util.money.cents_as_dollars( proposed_credit ); + }, + + 'retrieve' : function() { + var obj = this; + obj.bills = obj.network.request( + api.fm_mobts_having_balance.app, + api.fm_mobts_having_balance.method, + [ obj.session, obj.patron_id ] + ); } } -- 2.43.2