BUG: hiding a column by which the table is sorted breaks `multi column sorting`See original GitHub issue
please use the following example:
- remove the
- put it in the
- order by
voila! check your browser’s console, and you will see the message! the behavior is visualized in the following GIF.
the reason behind this behavior is that
slick-grid changes the entire column-set each time a column is set to be hidden; which causes the
getColumnIndex function to return
null, as the hidden column is not on the list of columns; obviously!
the solution is more complicated as far as I can tell! because many plugins and existing codes depend on the current implementation of the
getColumnIndex functions, it’s not easy to add a property - for example, called
visible ` to the column definition in order to control column visibility. hiding or showing columns shouldn’t be a matter or setting a new column-set, but rather a matter of changing their visibility and redrawing the whole table!
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@ghiscoding I took a more accurate look at how the
setupColumnSortfunction, in which this error occurs, works.
unfortunately, the functions
getColumnIndexdo not use the same variable; therefore, the
allColumnswill not resolve this issue directly. I believe, in order to resolve this specific issue I will need to define a
getColumnById(id, useOnlyVisibleColumns)function. will post my solution as soon as I am finished…
You are most welcome to create a PR to add the
allColumns, the GridMenu also uses the same code as ColumnPicker to show all columns, in my libs I a copy of
allColumnson ColumnPicker, Grid, on Filtering and Sorting and that seems to be it