Problems choosing SlickGrid in sorting

When using SlickGrids selectionand sortingtogether, I found that the selection stores the index of the selected rows, and does not save the selection for the selected data.

How can I fix this so that the selected data is remembered instead of the index?


A demonstration of the problem can be found here: http://jsfiddle.net/blowsie/LKf6j/

To reproduce the problem, follow these steps:

  • Select the first item in the grid.
  • Sort by name
+5
source share
2 answers
+5
source

.

, , , Slick.Data.DataView APi .

                dataView.onRowsChanged.subscribe(function (e, args) {
                    grid.invalidateRows(args.rows);
                    grid.render();
                });



                // initialize the model after all the events have been hooked up
                dataView.beginUpdate();
                dataView.setItems(files);
                dataView.endUpdate();

                dataView.syncGridSelection(grid, true);
+3

All Articles