From e884cc93820e6c347ca8cc958a18d6c19086691b Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 9 Oct 2006 00:42:24 +0000 Subject: [PATCH] added an "add" method to the fm_table for inserting rows in the fly, taking advantage of that in the output builder to decreate the perceived render time git-svn-id: svn://svn.open-ils.org/ILS/trunk@6407 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/fm_table.js | 4 +++ .../web/reports/oils_rpt_folder_window.js | 34 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Open-ILS/web/opac/common/js/fm_table.js b/Open-ILS/web/opac/common/js/fm_table.js index 5bfa913d65..e0d9b47db8 100644 --- a/Open-ILS/web/opac/common/js/fm_table.js +++ b/Open-ILS/web/opac/common/js/fm_table.js @@ -129,6 +129,10 @@ FMObjectBuilder.prototype.setKeys = function(o) { if(sortme) this.keys = this.keys.sort(); } +FMObjectBuilder.prototype.add = function(obj) { + this.buildObjectRow(obj); +} + /* Inserts one row into the table to represent a single object */ FMObjectBuilder.prototype.buildObjectRow = function(obj) { var row = elem('tr'); diff --git a/Open-ILS/web/reports/oils_rpt_folder_window.js b/Open-ILS/web/reports/oils_rpt_folder_window.js index b47caace5e..de4bd7a970 100644 --- a/Open-ILS/web/reports/oils_rpt_folder_window.js +++ b/Open-ILS/web/reports/oils_rpt_folder_window.js @@ -379,29 +379,35 @@ oilsRptFolderWindow.prototype.fetchFolderData = function(callback) { } -oilsRptFolderWindow.prototype.fleshSchedules = function(list, idx) { - if( idx >= list.length ) { - this.fmTable = drawFMObjectTable( - { - dest : this.selector, - obj : list, - selectCol : true, - selectColName : 'Select', - selectAllName : 'All', - selectNoneName : 'None' - } - ); - return; - } +oilsRptFolderWindow.prototype.fleshSchedules = function(list, idx, table) { + + if( idx >= list.length ) return; var sched = list[idx]; var obj = this; + oilsRptFetchUser(sched.runner(), + function(user) { sched.runner(user); oilsRptFetchTemplate(sched.report().template(), + function(template) { sched.report().template(template); + if( idx == 0 ) { + obj.fmTable = drawFMObjectTable( + { + dest : obj.selector, + obj : [sched], + selectCol : true, + selectColName : 'Select', + selectAllName : 'All', + selectNoneName : 'None' + } + ); + } else { + obj.fmTable.add(sched); + } obj.fleshSchedules(list, ++idx); } ); -- 2.43.2