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

Filter Menu default operator

Thread ID:

Created:

Updated:

Platform:

Replies:

143595 Mar 28,2019 10:47 AM UTC Apr 2,2019 05:10 AM UTC Angular - EJ 2 5
loading
Tags: Grid
Nastaran
Asked On March 28, 2019 10:47 AM UTC

Hi
I'm using filter menu for filtering in columns of my grids.
in the documents it said there's a solution for changing the default operator of filterbar, it doesn't work for filter menu.
how can I change the default operator of filter menu?
thanks in advance.

Madhu Sudhanan P [Syncfusion]
Replied On March 29, 2019 05:40 AM UTC

Hi Nastaran, 

Thanks for contacting us. 

You can change the order of the operator collection which is used default by the columns as follows in the dataBound event. With the below code, now string columns uses the contains as its default operator. 


    public dataBound(): void { 
        (<any>this.grid.filterModule).customOperators.stringOperator =  
        (<any>this.grid.filterModule).customOperators.stringOperator.sort(function(x,y){ 
          return x.value == 'contains' ? -1 : y.value == 'contains' ? 1 : 0; 
        }); 
    } 


 


If you want to change the operator list for other type columns, please change the order from the below properties of the customOperators. 

Number 
numberOperator 
Boolean 
booleanOperator 
Date 
dateOperator 
DateTime 
datetimeOperator 
 

Regards, 
Madhu Sudhanan P 


Nastaran
Replied On March 30, 2019 04:18 AM UTC

thanks very much. it worked

Thavasianand Sankaranarayanan [Syncfusion]
Replied On April 1, 2019 06:08 AM UTC

Hi Nastaran, 
 
We are happy that the problem has been solved. 
 
Please get back to us if you need any further assistance.  
                          
Regards, 
Thavasianand S.

Madhu Sudhanan P [Syncfusion]
Replied On April 2, 2019 05:10 AM UTC

Hi Naazaniqua, 
  
Thanks for the update. 
  
Regards, 
Madhu 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;