We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

removing filter options that are not required

Is it possible to remove filter options that are not required?
For example, in one column, only the 2 filters below are needed.




1 Reply

MS Mani Sankar Durai Syncfusion Team October 17, 2016 10:55 AM UTC

Hi Makoto, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we have achieved your requirement by using create event in grid. 

Please refer the below code example. 
   $(function () { 
            $("#Grid").ejGrid({ 
 
                columns: [ 
 
                ], 
                create: function (args) { 
                    var grid = $("#Grid").ejGrid("instance"); 
                    this.element.on("mousedown", ".e-gridheader .e-filtericon", function (argument) { 
                        var target = argument.target; 
                        $("#Grid_stringDlg").ejDialog({ 
                            //open event of the filter menu dialog 
                            open: function (e) { 
                                if ($(target).parent().find(".e-headercelldiv").attr("ej-mappingname") == "CustomerID") 
                                    $("#" + grid._id + "string_ddinput_popup_wrapper").find("li[value='Equal']").hide(); 
                                else 
                                    $("#" + grid._id + "string_ddinput_popup_wrapper").find("li[value='Equal']").show(); 
                            } 
                        }); 
                    }); 
                }, 
 
            }); 
        }); 
   </script> 


In the above code example, we have hidden the Equal Operator in the filter menu for the CustomerID column when the dialog gets open. 

We have also prepared a sample that can be available from the below link, 


Also refer the documentation link for create event in grid. 



Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


Loader.
Live Chat Icon For mobile
Up arrow icon