From 5839fe71f291e3236173c72cf702c11db926b290 Mon Sep 17 00:00:00 2001 From: Xinchao Zhang Date: Fri, 28 Jan 2022 17:18:05 +0800 Subject: [PATCH] setColumns should update the global treeColumns and columns variable --- slick.grid.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/slick.grid.js b/slick.grid.js index 27020ae1..89eca69b 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -2916,13 +2916,8 @@ if (typeof Slick === "undefined") { function setColumns(columnDefinitions) { trigger(self.onBeforeSetColumns, { previousColumns: columns, newColumns: columnDefinitions, grid: self }); - var _treeColumns = new Slick.TreeColumns(columnDefinitions); - if (_treeColumns.hasDepth()) { - treeColumns = _treeColumns; - columns = treeColumns.extractColumns(); - } else { - columns = columnDefinitions; - } + treeColumns = new Slick.TreeColumns(columnDefinitions); + columns = treeColumns.extractColumns(); updateColumnProps(); updateColumnCaches(); @@ -6166,4 +6161,4 @@ if (typeof Slick === "undefined") { Grid: SlickGrid } }); -}(jQuery)); \ No newline at end of file +}(jQuery));