Skip to content
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0e16e30
feat(grid): optimize grid row selection flow and performance
georgianastasov Aug 1, 2024
b16204f
feat(grid): optimize row selection and fix filtering and deletion tests
georgianastasov Aug 1, 2024
3ee7764
feat(grid): refactor row selection methods for improved clarity and p…
georgianastasov Aug 1, 2024
aa815b0
feat(grid): refine row selection logic
georgianastasov Aug 1, 2024
e979a6b
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Aug 19, 2024
ca83572
Merge branch 'master' into ganastasov/feat-14519-master
ddaribo Aug 19, 2024
6d6a6a6
Merge branch 'master' into ganastasov/feat-14519-master
ddaribo Aug 22, 2024
95f7a1c
Merge branch 'master' into ganastasov/feat-14519-master
ddaribo Aug 26, 2024
122a511
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Aug 28, 2024
dc5a267
Merge branch 'master' into ganastasov/feat-14519-master
ddaribo Aug 29, 2024
45b3974
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Sep 2, 2024
11c1eab
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Sep 3, 2024
867027e
feat(grid): optimize row selection flow to avoid redundant operations
georgianastasov Sep 11, 2024
7183e85
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Sep 11, 2024
e5ce55a
chore(grid): undoing recent unnecessary leftover changes
georgianastasov Sep 11, 2024
0400091
Merge branch 'master' into ganastasov/feat-14519-master
kacheshmarova Sep 19, 2024
2dc77bf
Merge branch 'master' into ganastasov/feat-14519-master
hanastasov Sep 19, 2024
97b93ba
feat(grid): improve row selection handling
georgianastasov Sep 20, 2024
9517211
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Sep 20, 2024
97478fe
Merge branch 'master' into ganastasov/feat-14519-master
hanastasov Sep 30, 2024
e1e1af4
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Sep 30, 2024
ccc2721
Merge branch 'master' into ganastasov/feat-14519-master
georgianastasov Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export class IgxGridSelectionService {

/** Select all rows, if filtering is applied select only from filtered data. */
public selectAllRows(event?) {
const addedRows = this.allData.filter((row) => !this.isRowSelected(this.getRecordKey(row)));
const addedRows = this.allData.filter((row) => !this.rowSelection.has(this.getRecordKey(row)));
const selectedRows = this.getSelectedRowsData();
const newSelection = this.rowSelection.size ? selectedRows.concat(addedRows) : addedRows;
this.indeterminateRows.clear();
Expand Down Expand Up @@ -616,10 +616,8 @@ export class IgxGridSelectionService {
if (this.allRowsSelected !== undefined && !newSelection) {
return this.allRowsSelected;
}
const selectedData = new Set(newSelection ? newSelection : [...this.rowSelection]);
const allData = this.getRowIDs(this.allData);
const unSelectedRows = allData.filter(row => !selectedData.has(row));
return this.allRowsSelected = this.allData.length > 0 && unSelectedRows.length === 0;
const selectedData = new Set(this.getRowIDs(newSelection || this.rowSelection));
return this.allRowsSelected = this.allData.length > 0 && this.allData.every(row => selectedData.has(this.getRecordKey(row)));
}

public hasSomeRowSelected(): boolean {
Expand All @@ -639,13 +637,16 @@ export class IgxGridSelectionService {
if (this.areEqualCollections(currSelection, newSelection)) {
return;
}

const args: IRowSelectionEventArgs = {
owner: this.grid,
oldSelection: currSelection,
newSelection,
added, removed,
event, cancel: false,
allRowsSelected: this.areAllRowSelected(newSelection.map(r => this.getRecordKey(r)))
added,
removed,
event,
cancel: false,
allRowsSelected: this.areAllRowSelected(newSelection)
};

this.grid.rowSelectionChanging.emit(args);
Expand Down
Loading