Seeking guidance on implementing range selection in Angular within a mat-table. Previously implemented with a simple array for the datasource, but current project utilizes a custom Datasource class.
Example of range selection with a basic datasource:
https://stackblitz.com/edit/angular-xljvp4
To select a range of rows, first click on the initial row, hold down the shift key, and then select the final row.
Encountering challenges with my project's custom Datasource :
Datasource :
// Excerpt from Datasource class
// Methods connect, disconnect, loadProduct
Desire to iterate through all data in the custom Datasource similar to the stackblitz example:
ELEMENT_DATA.forEach((item,index) => {
if(index >= this.indexSelected && index <= alldata){
item.isSelected = true;
this.productsArray.push(item);
}else{
item.isSelected = false;
}
})
Seeking advice on looping through all data within a custom Datasource. Any assistance is appreciated!