get data of selected rows in slickgrid

前端 未结 5 450
渐次进展
渐次进展 2021-01-05 08:04

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 sele

5条回答
  •  情歌与酒
    2021-01-05 08:23

    You can also use this line in the .each loop to pull the data from the dataView instead of using getData() from the grid object, since that seems to be inconsistent depending on the fork:

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

提交回复
热议问题