Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Sep 20, 2023
1 parent 4b896c3 commit ec8c56a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/data/data-grid/export/PrintExportSelectedRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
DataGrid,
GridToolbar,
gridFilteredSortedRowIdsSelector,
selectedGridRowsSelector,
} from '@mui/x-data-grid';

const getSelectedRowsToExport = ({ apiRef }) => {
const selectedRowIds = Array.from(apiRef.current.getSelectedRows().keys());

if (selectedRowIds.length > 0) {
return selectedRowIds;
const selectedRowIds = selectedGridRowsSelector(apiRef);
if (selectedRowIds.size > 0) {
return Array.from(selectedRowIds.keys());
}

return gridFilteredSortedRowIdsSelector(apiRef);
Expand Down
8 changes: 4 additions & 4 deletions docs/data/data-grid/export/PrintExportSelectedRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import {
GridToolbar,
GridPrintGetRowsToExportParams,
gridFilteredSortedRowIdsSelector,
selectedGridRowsSelector,
GridRowId,
} from '@mui/x-data-grid';

const getSelectedRowsToExport = ({
apiRef,
}: GridPrintGetRowsToExportParams): GridRowId[] => {
const selectedRowIds = Array.from(apiRef.current.getSelectedRows().keys());

if (selectedRowIds.length > 0) {
return selectedRowIds;
const selectedRowIds = selectedGridRowsSelector(apiRef);
if (selectedRowIds.size > 0) {
return Array.from(selectedRowIds.keys());
}

return gridFilteredSortedRowIdsSelector(apiRef);
Expand Down

0 comments on commit ec8c56a

Please sign in to comment.