function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
satish waghsatish wagh 

Filtering not working properly with paging

I have a Datatable of 500 entries, each page contains 50 entries.
When I try to filter a property, I excepted it to filter all 500 entries, and paging the filtered result. But it only filter the 50 entries of the current page. Is this a bug? Can I configure somewhere to make it works as I excepted?

handleKeyChange(event) { var ordLst = JSON.parse(JSON.stringify(this.data)); const searchWord = event.detail.value; var results = ordLst, regex; var count; if(searchWord !==""){ try { regex = new RegExp(searchWord, "i"); // filter checks each row, constructs new array where function returns true results = ordLst.filter(row=>regex.test(row.CustomerNo) || regex.test(row.OrderStatus) || regex.test(row.SalesDocument) || regex.test(row.ShiptoCity) || regex.test(row.OrderDate.toString())); } catch(e) { // invalid regex, use full list } count = Object.keys(results).length; this.data = results; this.searchData(count,results,searchWord); } else { this.LoadData(this.value); } }