From 5fcb8d47f00ab98b5643a0c8cbfceae0f1396f5f Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 20 Jul 2005 14:26:45 +0000 Subject: [PATCH] use DOM to remove listbox rows instead of listbox methods. Use a timeout to make sure things are rendered (the listbox is created dynamically). Firefox and XULRunner now look identical git-svn-id: svn://svn.open-ils.org/ILS/trunk@1301 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../content/evergreen/patron/patron_bills.js | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js index 2a605f7ddb..44e7c36bff 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js +++ b/Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js @@ -52,7 +52,7 @@ function list_box_init( p ) { p.listbox.appendChild( listcols ); /*if (window.navigator.userAgent.match( /Firefox/ ))*/ { - sdump('D_FIREFOX','Kludge: Adding extra listheader and listcol\n'); + //sdump('D_FIREFOX','Kludge: Adding extra listheader and listcol\n'); var listheader = p.w.document.createElement('listheader'); listhead.appendChild( listheader ); listheader.setAttribute('label', ''); @@ -82,7 +82,7 @@ function list_box_init( p ) { } /* if (window.navigator.userAgent.match( /Firefox/ )) */ { - sdump('D_FIREFOX','Kludge: Setting label on listitem\n'); + //sdump('D_FIREFOX','Kludge: Setting label on listitem\n'); listitem.setAttribute('label',' '); } @@ -98,7 +98,11 @@ function list_box_init( p ) { } p.clear_rows = function () { - while( p.listbox.getRowCount() > 0 ) { p.listbox.removeItemAt(0); } + var count = p.listbox.getRowCount(); + for (var i = 0; i < count; i++) { + p.listbox.removeChild( p.listbox.lastChild ); + } + alert('pause'); } return p; @@ -182,13 +186,11 @@ function patron_bills_add_patron_bills(p, bills) { return grid; } - function gen_timeout_add_row( cols, mbts ) { - return function() { p.list_box.add_row( cols, { 'record_id' : mbts.id() } ) }; - } - var obj_string ='mbts'; - setTimeout( function(){p.list_box.clear_rows();}, 0 ); + setTimeout( + function() { + //p.list_box.clear_rows(); for (var i = 0; i < bills.length; i++) { @@ -230,6 +232,8 @@ function patron_bills_add_patron_bills(p, bills) { } cols.push( listcell ); } - setTimeout( gen_timeout_add_row( cols, mbts), 0); + p.list_box.add_row( cols, { 'record_id' : mbts.id() } ); } + }, 0 + ); } -- 2.43.2