python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
23 Best Kendo UI Angular 2 DropDownList Actions [How To]

Kendo ui Angular 2 Filters Dropdown List [How To]

“How to filter dropdown list using kendo ui Angular 2”?

The “Kendo UI Angular 2 DropDownList” is a form component and used binds the data list and chooses a single predefined value as per you from a dropdown list.

Filters are concepts that work with separation of record based on column and these filters are used to display the array items are filtered by the help of user input filter key text and on every character input the component triggers a filterChange event and returns back to the filtered result.

To enable the filterable property, we need to set the filterable property is true and the detail show in below example,

Stayed Informed – Live demo Plunker                                          

Example as,

@Component({
  selector: 'my-app',
  template: `
    <kendo-dropdownlist  [data]="data" [filterable]="true"
        [textField]="'text'" [valueField]="'value'"
        (filterChange)="ddlFilter($event)"></kendo-dropdownlist>`
})

class AppComponent {
    public source: Array<{ text: string, value: number }> = [
        { text: "Anil Singh", value: 1 },
        { text: "Sunil", value: 2 },
        { text: "Alok", value: 3 },
        { text: "Dilip", value: 4 },
        { text: "Raju", value: 5 },
        { text: "Avalish", value: 6 },
        { text: "Sanjay", value: 7 }
    ];
  
    public data: Array<{ text: string, value: number }>;
  
    constructor() {
        this.data = this.source.slice();
    }

    ddlFilter(value) {
        this.data = this.source.filter((txt) => txt.text.toLowerCase().indexOf(value.toLowerCase()) !== -1);
    }
}

References,


I hope you are enjoying with this post! Please share with you friends. Thank you!!
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions