Hi Ashok,
Thanks for contacting Syncfusion support.
Query: I want to sort the Filtering options like when ever user opens the filter dialog then selected filter needs to come first remaining later
Based on your requirement, you want to show the checked (filtered) value always top in the CheckBox Filter popup. You can achieve your requirement by using the following code example in the actionComplete (requestType as filterchoicerequest) event of Grid.
|
[app.component.ts]
actionComplete(args){
if(args.requestType == "filterchoicerequest"){
if(args.filterModel.isFiltered > 0){
// get all the checklist in the popup
var filterlists = args.filterModel.dlg.querySelector('.e-checkboxlist');
for( var i=0; i<filterlists.children.length; i++){
if(filterlists.children[i].getElementsByClassName('e-check').length > 0){
// move the checked item to the top
filterlists.insertBefore(filterlists.children[i],filterlists.children[1]);
}
}
}
}
}
|
We have prepared a sample for your reference. You can get it from the below link,
Please get back to us if you need further assistance with this.
Regards,
Rajapandiyan S