Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setColumns should update the global treeColumns and columns variable #665

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can hardly accept this PR, we actually were thinking to get rid of it, but you are trying to making it the only option. There's a long post about this in this issue #592, I still don't understand what this tree does exactly

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whew! Just read through all of that for #592. So it looks like we never actually did get rid of TreeColumns? I do think there are much less complex ways of implementing column grouping than a tree structure, and given that the column array is a fundamental part of SlickGrid, it's best not messed with.


updateColumnProps();
updateColumnCaches();
Expand Down Expand Up @@ -6166,4 +6161,4 @@ if (typeof Slick === "undefined") {
Grid: SlickGrid
}
});
}(jQuery));
}(jQuery));