Yay! Inserting an empty listitem into a listbox gives us the magic column we hate...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 19 Dec 2005 15:20:26 +0000 (15:20 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 19 Dec 2005 15:20:26 +0000 (15:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2441 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/util/list.js
Open-ILS/xul/staff_client/server/patron/bills.js

index 059ea32..61a5c86 100644 (file)
@@ -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;
index 66ad2c3..11aeee6 100644 (file)
@@ -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 ]
+               );
        }
 }