get data of selected rows in slickgrid

Preli picture Preli · Oct 30, 2011 · Viewed 26.3k times · Source

I have a slickgrid in which some rows are hidden by a filter (DataView).

When I now call the getSelectedRows method of the grid I get the indices of the visibly selected rows. But I need the actual data of the selected rows.

Answer

matma picture matma · Oct 30, 2011

You must do something like this:

var selectedData = [],
    selectedIndexes;

selectedIndexes = _grid.getSelectedRows();
jQuery.each(selectedIndexes, function (index, value) {
  selectedData.push(_grid.getData()[value]);
});

Right now the selectedData variable contains data for selected rows.