From a01c7230dd455189b791c258a13f36c77cacbaaf Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 15 Mar 2012 13:54:02 -0400 Subject: [PATCH] AutoGrid line number CSS application cleanup Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- .../web/js/dojo/openils/widget/AutoGrid.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index ba789e19a5..0faa3ee996 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -30,17 +30,6 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { lineNumberWidth : '1.5', showColumnPicker : false, columnPickerPrefix : null, - onStyleRow : function(row) { - // FIXME: this really feels kludgy (sensitive to how dojo constructs the HTML), and is - // probably not idiomatic dojo - if (!this.hideLineNumber) { - if (this.hideSelector) { - dojo.addClass(row.node.firstChild.firstChild.firstChild.childNodes[0],'autoGridLineNumber'); - } else { - dojo.addClass(row.node.firstChild.firstChild.firstChild.childNodes[1],'autoGridLineNumber'); - } - } - }, displayLimit : 15, displayOffset : 0, requiredFields : null, @@ -51,6 +40,14 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { /* by default, don't show auto-generated (sequence) fields */ showSequenceFields : false, + // style the cells in the line number column + onStyleRow : function(row) { + if (!this.hideLineNumber) { + var cellIdx = this.hideSelector ? 0 : 1; + dojo.addClass(this.views.views[0].getCellNode(row.index, cellIdx), 'autoGridLineNumber'); + } + }, + startup : function() { this.selectionMode = 'single'; this.sequence = openils.widget.AutoGrid.sequence++; -- 2.43.2