Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a kendo ui grid then I apply the filter to it. The principle is here demo.

The only difference is the data source is a string array. In ngOninit, I get the source data then I used
JavaScript
handleFilter(value) {
          this.data = this.source.filter(s => s.toLowerCase().indexOf(value.toLowerCase()) !== -1);
        }

Basically when you open the dropdown then a whole list and a textbox showing up. If you type any string in the textbox then the filter should work and the list changes. You can open the StackBlize to look at the result on the link I provided.

The funny thing is it works a few times then stop working. It means whatever you input it always displays the whole list. Not sure why?

What I have tried:

this.data = this.source.filter(s => s.toLowerCase().indexOf(value.toLowerCase()) !== -1);


I used
CSS
s=>s.toLowerCase()
, the link uses
CSS
(s)=>s.toLowerCase()


But I don't think it is different.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900