},
false
);
- /*
- setTimeout(
- function() {
- util.widgets.dispatch('flesh',treerow);
- }, 0
- );
- */
+ if (typeof params.flesh_immediately != 'undefined') {
+ if (params.flesh_immediately) {
+ setTimeout(
+ function() {
+ util.widgets.dispatch('flesh',treerow);
+ }, 0
+ );
+ }
+ }
} else {
obj.put_retrieving_label(treerow);
treerow.addEventListener(
},
false
);
- /*
- setTimeout(
- function() {
- util.widgets.dispatch('flesh',treerow);
- }, 0
- );
- */
+ if (typeof params.flesh_immediately != 'undefined') {
+ if (params.flesh_immediately) {
+ setTimeout(
+ function() {
+ util.widgets.dispatch('flesh',treerow);
+ }, 0
+ );
+ }
+ }
}
this.error.sdump('D_LIST',s);
},
false
);
- /*
- setTimeout(
- function() {
- util.widgets.dispatch('flesh',treerow);
- }, 0
- );
- */
+ if (typeof params.flesh_immediately != 'undefined') {
+ if (params.flesh_immediately) {
+ setTimeout(
+ function() {
+ util.widgets.dispatch('flesh',treerow);
+ }, 0
+ );
+ }
+ }
+
} else {
s += 'did not find a retrieve_row function\n';
},
false
);
- /*
- setTimeout(
- function() {
- util.widgets.dispatch('flesh',treerow);
- }, 0
- );
- */
+ if (typeof params.flesh_immediately != 'undefined') {
+ if (params.flesh_immediately) {
+ setTimeout(
+ function() {
+ util.widgets.dispatch('flesh',treerow);
+ }, 0
+ );
+ }
+ }
+
}
try {
'_map_row_to_treecell' : function(params,treerow) {
var obj = this;
var s = '';
- util.widgets.remove_children(treerow);
+ //util.widgets.remove_children(treerow);
+ var create_treecells = treerow.childNodes.length == 0;
if (typeof params.map_row_to_column == 'function' || typeof this.map_row_to_column == 'function') {
for (var i = 0; i < this.columns.length; i++) {
- var treecell = document.createElement('treecell');
+ var treecell = create_treecells ? document.createElement('treecell') : treerow.childNodes[i];
if ( this.columns[i].editable == false ) { treecell.setAttribute('editable','false'); }
var label = '';
if (params.skip_columns && (params.skip_columns.indexOf(i) != -1)) {
}
if (this.columns[i].type == 'checkbox') { treecell.setAttribute('value',label); } else { treecell.setAttribute('label',label ? label : ''); }
- treerow.appendChild( treecell );
+ if (create_treecells) { treerow.appendChild( treecell ); }
s += ('treecell = ' + treecell + ' with label = ' + label + '\n');
}
} else if (typeof params.map_row_to_columns == 'function' || typeof this.map_row_to_columns == 'function') {
}
for (var i = 0; i < labels.length; i++) {
- var treecell = document.createElement('treecell');
+ var treecell = create_treecells ? document.createElement('treecell') : treerow.childNodes[i];
if ( this.columns[i].editable == false ) { treecell.setAttribute('editable','false'); }
if ( this.columns[i].type == 'checkbox') {
treecell.setAttribute('value', labels[i]);
} else {
treecell.setAttribute('label',typeof labels[i] == 'string' || typeof labels[i] == 'number' ? labels[i] : '');
}
- treerow.appendChild( treecell );
+ if (create_treecells) { treerow.appendChild( treecell ); }
s += ('treecell = ' + treecell + ' with label = ' + labels[i] + '\n');
}
function gen_list_append_func(r) {
return function() {
- if (typeof r == 'object') { g.row_map[ r.id() ] = g.bill_list.append( { 'retrieve_id' : r.id(), 'row' : { 'my' : { 'checked' : true, 'mbts' : r } } } );
- } else { g.row_map[r] = g.bill_list.append( { 'retrieve_id' : r, 'row' : { 'my' : { 'checked' : true } } } ); }
+ if (typeof r == 'object') { g.row_map[ r.id() ] = g.bill_list.append( { 'retrieve_id' : r.id(), 'flesh_immediately' : true, 'row' : { 'my' : { 'checked' : true, 'mbts' : r } } } );
+ } else { g.row_map[r] = g.bill_list.append( { 'retrieve_id' : r, 'flesh_immediately' : true, 'row' : { 'my' : { 'checked' : true } } } ); }
}
}
try {
if ( row && row.my && row.my.mbts && Number( row.my.mbts.balance_owed() ) < 0 ) {
util.widgets.addProperty(params.row_node.firstChild,'refundable');
+ util.widgets.addProperty(params.row_node.firstChild.childNodes[ g.payment_pending_column_idx ],'refundable');
}
if ( row && row.my && row.my.circ && ! row.my.circ.checkin_time() ) {
$('circulating_hint').hidden = false;
util.widgets.addProperty(params.row_node.firstChild,'circulating');
+ util.widgets.addProperty(params.row_node.firstChild.childNodes[ g.title_column_idx ],'circulating');
}
} catch(E) {
g.error.sdump('D_WARN','Error setting list properties in bill2.js: ' + E);
}
} );
+ g.title_column_idx = util.functional.map_list( g.bill_list.columns, function(o) { return o.id; } ).indexOf( 'title' );
+ g.payment_pending_column_idx = util.functional.map_list( g.bill_list.columns, function(o) { return o.id; } ).indexOf( 'payment_pending' );
$('bill_list_actions').appendChild( g.bill_list.render_list_actions() );
g.bill_list.set_list_actions();
}