Hi Sudipa,
Greetings from Syncfusion support
After reviewing the information you provided, we understand
that you initially applied a filter in the Grid and, after performing certain
actions, you want to clear the current filter and revert to your original
filter settings programmatically when a button is clicked. Based on your
request we have prepared the sample in Angular platform, and we suggest you use
the below way to achieve your requirement.
In this following sample, we clear the filter using the clearFiltering
method on the button click event and then reapply the initial filter values to
the Grid's filterSettings. Please refer to the code example and sample below
for further details.
|
App.component.ts
reset()
{ //reset button click
//invoke the clearFiltering method to clear the filtering in the Grid
this.grid.clearFiltering();
setTimeout(function() {
//here we setback the initial filter values to the Grid
this.grid.filterSettings.columns
= [{ field: 'Employees', matchCase: false, operator: 'startswith', predicate:
'and', value: 'Nancy' },
{ field:
'Designation', matchCase: false, operator: 'startswith', predicate: 'and',
value: 'Designer' }];
}.bind(this));
}
|
Sample: https://stackblitz.com/edit/angular-b4uvjf-r7zt4m?file=src%2Fapp.component.ts,src%2Fapp.component.html
Regards,
Aishwarya R