From 0875f6d9c5e2c8acd719ff71cca2da39f9df0753 Mon Sep 17 00:00:00 2001 From: junfengye Date: Sat, 7 Jun 2014 12:55:09 +0800 Subject: [PATCH] logic error for hiddenColumns._syncOrder ? error happens when j == cols.length - 1 and cols[j].hidden = true --- modules/HiddenColumns.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/HiddenColumns.js b/modules/HiddenColumns.js index be6c6eb5e..06f92640c 100644 --- a/modules/HiddenColumns.js +++ b/modules/HiddenColumns.js @@ -278,10 +278,10 @@ define([ //Sort the cached columns to have the same order as g._columns. for(; i < columns.length && j < cols.length; ++i, ++j){ //j must not overflow here because t._cols and g._columns are synced up. - for(c = cols[j]; c.hidden; c = cols[j]){ + for(c = cols[j]; c && c.hidden; c = cols[j]){ ++j; } - if(columns[i] != c){ + if(c && columns[i] != c){ k = array.indexOf(cols, columns[i]); cols[j] = cols[k]; cols[k] = c;