This is a migrated thread and some comments may be shown as answers.

Grid filtering not works on one column

1 Answer 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 26 Mar 2020, 09:46 AM

I have a one of legacy applications with AngularJS + KendoUI.

I have a grid when I have defined filter like that:

"filterTemplates": {
            "commonInput": function (args) {
                args.element.css("width", "90%").addClass("k-textbox").keyup(function (e) {
                    e.preventDefault();
                    if (e.target.value.length >= 3) {
                        setTimeout(function () {
                            $(e.target).delay(1000).trigger("change");
                        }, 500);
                    }
                });
            },

//. other filters like datetime, etc...,never mind in this example

}

and two columns:

{
     "title": "Name",
     "field": "UserName",
     "width": "9%",
     "encoded": true,
     "filterable": {
                        "cell": {
                            "showOperators": false,
                            "operator": "contains",
                            "template": vm.gridPreInitConfig.filterTemplates.commonInput
                        }
       }

},

{
        "title": "Surname",
        "field": "UserSurname",
        "width": "9%",
        "encoded": true,
        "filterable": {
                     "cell": {
                          "showOperators": false,
                          "operator": "contains",
                          "template": vm.gridPreInitConfig.filterTemplates.commonInput
                      }
         }
}

And now:

If I set  a value in textbox filter in Name column the grid  processing and is filtered perfectly, after a while.

But if I set a value in textbox filter in Surname column the grid processing and not filtered.

 

Please, help. Why the second column with the same filter doesn't work?

I tried also duplicate the filter in other name, but still doesn't work.

 

 

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 30 Mar 2020, 08:20 AM

Hi, Paul,

I used the provided code snippets in a Dojo and it it does what the custom code is created for both the FirstName and LastName columns:

https://dojo.telerik.com/@bubblemaster/ikiFeHos

I can see that the code expects an input value of 3 characters so it is expected if you are testing with less than three nothing would occur.

I would suggest you test with the example we have in the documentation:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-filter-as-you-type

"commonInput": function (args) {
                args.element.css("width", "90%").addClass("k-textbox").attr("data-value-update", "input");
            }

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or