From b0d81ef45f92f6dcd4db7af01f82e8faba5a7361 Mon Sep 17 00:00:00 2001 From: Dmitry Nechai Date: Wed, 17 Apr 2013 00:33:57 +0300 Subject: [PATCH] Fixed bug in staff client offline mode. https://bugs.launchpad.net/evergreen/+bug/1089657 In list.js at start you create obj.columns for lineno, but later you don`t process this value so it`s return default render function. This code repairs this. Signed-off-by: Dmitry Nechai Signed-off-by: Jason Stephenson --- .../staff_client/chrome/content/util/list.js | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 8166016a02..2d4c33a710 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -11,6 +11,8 @@ util.list = function (id) { this.sub_sorts = []; + this.count_for_display = 0; + if (!this.node) throw('Could not find element ' + id); switch(this.node.nodeName) { case 'listbox' : @@ -1227,13 +1229,27 @@ util.list.prototype = { } if (typeof params.map_row_to_column == 'function') { + if (this.columns[i].id == 'lineno'){ + + label = this.count_for_display.toString(); + this.count_for_display++; + + } else { - label = params.map_row_to_column(params.row,this.columns[i],this.scratch_data); - + label = params.map_row_to_column(params.row,this.columns[i],this.scratch_data); + + } } else if (typeof this.map_row_to_column == 'function') { + if (this.columns[i].id == 'lineno'){ + + label = this.count_for_display.toString(); + this.count_for_display++; + + } else { + + label = this.map_row_to_column(params.row,this.columns[i],this.scratch_data); - label = this.map_row_to_column(params.row,this.columns[i],this.scratch_data); - + } } if (this.columns[i].type == 'checkbox') { treecell.setAttribute('value',label); } else { treecell.setAttribute('label',label ? label : ''); } s += ('treecell = ' + treecell + ' with label = ' + label + '\n'); -- 2.43.2