Get searched records on multiple pages

Hello,

I know it's possible to get the filtered rows for a grid (getFilteredRecords()) and it will return all my filtered records on multiple pages, but i also want to get the "searchedRecords" of multiple pages, is this possible?

I use the 'Search' option in the toolbar. See stackblitz

https://stackblitz.com/edit/angular-uo59kz-euajf5?file=app.component.ts

When i use the getCurrentViewRecords() i only get the items from the first page.


With kind 



3 Replies 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team December 10, 2021 10:46 AM UTC

Hi Frank Reuvers, 
 
Thanks for contacting Syncfusion support. 
 
We have validated your query at our end. You can achieve this by using following code example. 
 
 
[app.component.ts] 
 
 
  onSearchClick(args) { 
    var searchedRecordsany = []; 
    if (this.grid.searchSettings.key.length > 0) { 
      // execute the current query with the dataSource 
      searchedRecords = new DataManager(this.grid.dataSource as Object[]).executeLocal(this.grid.getDataModule().generateQuery(true)); 
    } 
    console.log(searchedRecords); 
  } 
 
 
 
 
Please get back to us if you need further assistance with this. 
 
Regards, 
Rajapandiyan S 


Marked as answer

FR Frank Reuvers December 10, 2021 10:51 AM UTC

Thanks, that works!



RR Rajapandi Ravi Syncfusion Team December 13, 2021 06:18 AM UTC

Hi Frank, 

Thanks for the update. 

We are happy to hear that the provided solution works fine at our end. 

Please get back to us if you need further assistance. 

Rajapandi R 


Loader.
Up arrow icon