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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

removing filter options that are not required

Thread ID:

Created:

Updated:

Platform:

Replies:

126437 Oct 14,2016 04:38 PM UTC Oct 17,2016 10:55 AM UTC JavaScript 1
loading
Tags: ejGrid
Makoto Ohki
Asked On October 14, 2016 04:38 PM UTC

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




Mani Sankar Durai [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;