From: Dmitry Nechai Date: Tue, 16 Apr 2013 21:33:57 +0000 (+0300) Subject: Fixed bug in staff client offline mode. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b0d81ef45f92f6dcd4db7af01f82e8faba5a7361;p=contrib%2FConifer.git 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 --- 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');