Skip to content

Commit

Permalink
feat(dataView): add getAllSelectedItems function (#544)
Browse files Browse the repository at this point in the history
- also renamed `getAllSelectedRows` to `getAllSelectedIds`
  • Loading branch information
ghiscoding committed Oct 16, 2020
1 parent 6f6767c commit 39707b8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions slick.dataview.js
Expand Up @@ -1122,10 +1122,21 @@
return onSelectedRowIdsChanged;
}

function getAllSelectedRows(){
/** Get all selected IDs */
function getAllSelectedIds(){
return selectedRowIds;
}

/** Get all selected dataContext items */
function getAllSelectedItems() {
var selectedData = [];
var selectedIds = getAllSelectedIds();
selectedIds.forEach(function (id) {
selectedData.push(self.getItemById(id));
});
return selectedData;
}

function syncGridCellCssStyles(grid, key) {
var hashById;
var inHandler;
Expand Down Expand Up @@ -1196,6 +1207,8 @@
"collapseGroup": collapseGroup,
"expandGroup": expandGroup,
"getGroups": getGroups,
"getAllSelectedIds": getAllSelectedIds,
"getAllSelectedItems": getAllSelectedItems,
"getIdxById": getIdxById,
"getRowByItem": getRowByItem,
"getRowById": getRowById,
Expand Down Expand Up @@ -1230,8 +1243,6 @@
"onPagingInfoChanged": onPagingInfoChanged,
"onGroupExpanded": onGroupExpanded,
"onGroupCollapsed": onGroupCollapsed,

"getAllSelectedRows": getAllSelectedRows
});
}

Expand Down

0 comments on commit 39707b8

Please sign in to comment.