From 4d31dc281c6ce172b3d662df2f019e655d78faa4 Mon Sep 17 00:00:00 2001 From: Matthew Maxwell Date: Wed, 6 Mar 2013 14:13:14 -0600 Subject: [PATCH] Only execute a remove call if the remove handler exists. If a column is already hidden, don't try to hide it again. --- extensions/ColumnHider.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/ColumnHider.js b/extensions/ColumnHider.js index c20116162..248e42ced 100644 --- a/extensions/ColumnHider.js +++ b/extensions/ColumnHider.js @@ -217,6 +217,10 @@ function(declare, has, listen, miscUtil, put){ // Use miscUtil function directly, since we clean these up ourselves anyway var selectorPrefix = "#" + miscUtil.escapeCssIdentifier(this.domNode.id) + " .dgrid-column-", next, rules, i; // used in IE8 code path + + if (this._columnHiderRules[id]) { + return; + } if(has("ie") === 8 && !has("quirks")){ // Avoid inconsistent behavior in IE8 when display: none is set on a cell @@ -249,7 +253,7 @@ function(declare, has, listen, miscUtil, put){ // method for more information. if(!hidden){ - this._columnHiderRules[id].remove(); + this._columnHiderRules[id] && this._columnHiderRules[id].remove(); delete this._columnHiderRules[id]; }else{ this._hideColumn(id);