Every time load the 20 records in grid table after scroll down. If we are select the multiple row then load to the another 20 records that scroll position move to the selected row.
But we need the scroll position and selected row of grid should
be same as before data update
Analysis
get the selected row element before dataSource
are update and then once datasource is update set the attribute aria-selected value true on the specified selected row.
It’s also not working.
1.
ScrollIntoview
, ScrollTop , ScrollPosition, ScrollTo methods are used after the table data is Appended. It’s also
not working.
actionComplete($event) {
if ($event.requestType === 'refresh') {
this.selectedrowindex.map( x => {
const prevselectrow = this.searchGrid.getRows()[x];
for (let i = 0; i < prevselectrow.children.length; i++) {
prevselectrow.children[i].className = 'e-rowcell e-selectionbackground e-active';
prevselectrow.children[i].setAttribute('aria-selected', 'true');
}
});
}
}
loadData() {
//this.searchStatus = this.searchServ.totalFound + ' result found for ' + '"' + this.searchServ.searchCriteria + '"';
this.searchServ.updateSearchStatus();
this.totalFound = this.searchServ.totalFound;
this.endIndex = this.searchServ.endIndex;
if (this.searchServ.totalFound > 0) {
this.columnsDetails = this.searchServ.getColumns();
this.searchResultData = this.searchServ.getDatas();
if (this.searchServ.totalFound > this.searchServ.endIndex) {
this.showLoadMoreBtn = true;
//this.showOrHideLoadingSpan();
this.searchServ.startIndx = this.searchServ.startIndx + 20;
} else {
this.showLoadMoreBtn = false;
//this.showOrHideLoadingSpan();
}
} else {
this.searchResultData = [];
this.showLoadMoreBtn = false;
//this.showOrHideLoadingSpan();
}
this.showOpenBtn = true;
this.showFilterBtn = true;
}
Attachment:
searchresulttableview_5346ff8d.zip