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.
Unfortunately, activation email could not send to your email. Please try again.

Default Filter Operator Type Change

Thread ID:

Created:

Updated:

Platform:

Replies:

127987 Dec 22,2016 03:55 PM Dec 27,2016 04:15 AM ASP.NET MVC 4
loading
Tags: Grid
Diamond
Asked On December 22, 2016 03:55 PM

I am trying to change the default filter operator of a string type column with no sucsess using the Html helper syncfuison has provided. 
i have the following: 

    @(Html.EJ().DataManager("FlatData").URL(Url.Action("NscDataSource", "Home", null, Request.Url.Scheme)).Adaptor(AdaptorType.UrlAdaptor))
    @(Html.EJ().Grid<NscTicketInfo>("Grid")
        .DataManagerID("FlatData")
        .AllowPaging()
        .AllowSorting()
        .AllowMultiSorting()
        .AllowFiltering()
        .AllowSearching()
        .ContextMenuSettings(contextMenu =>
        {
            contextMenu.EnableContextMenu();
        })
        .Columns(c =>
        {
            c.Field(f => f.ID).Width(60).Add();
            c.Field(f => f.GlobalTicket.TicketDisplayID).Width(60).Add();
            c.Field(f => f.Customer).Width(80).Add();
            c.Field(f => f.Contact).Width(150).Add();
            c.Field(f => f.Phone1).Width(120).Add();
            c.Field(f => f.Fax).Width(120).Add();
            c.Field(f => f.Email).Width(150).Add();
            c.Field(f => f.Address).Width(150).Add();
            c.Field(f => f.State).Width(60).Add();
            c.Field(f => f.Zip).Width(60).Add();
            c.Field(f => f.CategorizationLink).Width(50).Add();
            c.Field(f => f.SourceLink).Width(40).Add();
            c.Field(f => f.TraceID).Width(200).Add();
        })
        .FilterSettings(Sett => Sett.FilterBarMode(FilterBarMode.OnEnter)
            .FilteredColumns(col => col.Field("Customer").Operator(FilterOperatorType.Equals).Add()))
        .SortSettings(sort => sort.SortedColumns(col => col.Field("ID").Direction(SortOrder.Ascending).Add()))
        .PageSettings(p => p.PageSize(30).EnableQueryString())
        .ClientSideEvents(e => e
            .Create("create")
            .ActionComplete("onComplete")
            .ActionBegin("actionBegin")
          ))


the highligheted lines are what i expect to change the defualt setting but i cannot figure out what i am missing. The grid will still post a dataManager with a where clause that has a startswith predicate. 

Thank You
DIamond

Jayaprakash Kamaraj [Syncfusion]
Replied On December 23, 2016 04:22 AM

 
Hi Diamond, 
 
Thank you for contacting Syncfusion support. 
 
We have already discussed the same in following knowledge base document. 


Regards, 
 
Jayaprakash K. 


Diamond
Replied On December 23, 2016 09:05 AM

Awesome yes i did also find this piece of code. cool.
How do i tie that to an individual column? i do not want to change all of the defaults only one particular column.

Diamond
Replied On December 23, 2016 12:57 PM

You can use the currentFilteringColumn  property to change the default filter of a particular column instead of changing all of the defaults


    function actionBegin(args) {
        if (args.requestType == "filtering" && args.currentFilteringColumn == "Customer")
        {
            args.currentFilterObject[0].operator = "equal";
        }  

Jayaprakash Kamaraj [Syncfusion]
Replied On December 27, 2016 04:15 AM

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


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.

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.

;