Kendo-angular: dropdownlist Reset selectedItem to defaultItem not working

Created on 12 May 2017  路  4Comments  路  Source: telerik/kendo-angular

I've created a dropdownlist with a default Value and when I try to reset the dropdownlist with the default Value with an extra button. Then the ngModel Value is set, but the dropdownlist don't shows the "defaultItem" as selected Value

grafik

then i click the reset Button

grafik

and you see the model looks good but not the Viewed Item.

Example Plunkr

http://plnkr.co/edit/a1bOz208yxttj2AfUDPJ?p=preview

dropdowns

Most helpful comment

In the template, add this attribute into your kendo ddl component elemnent : #itemsDdl.
Add this property in the class @ViewChild('itemsDdl') itemsDdl;
and in your reset() function just add : this.itemsDdl.reset() and Voila!

All 4 comments

This is intended behavior. The default data item is actually not part of the data items, it is an extra item.
It will be selected only when the value of the component is not set. That said if you set the value to null default data item will be selected.

Here is the updated example - http://plnkr.co/edit/76hFIiQzUzqBqhz73EJV?p=preview

works fine : -)

In the template, add this attribute into your kendo ddl component elemnent : #itemsDdl.
Add this property in the class @ViewChild('itemsDdl') itemsDdl;
and in your reset() function just add : this.itemsDdl.reset() and Voila!

work fine ! when I binding ngModel and set ngModel to null.
You can follow this link ...
http://next.plnkr.co/edit/76hFIiQzUzqBqhz73EJV?p=preview&preview

Was this page helpful?
0 / 5 - 0 ratings

Related issues

djarekg picture djarekg  路  18Comments

papushe picture papushe  路  14Comments

jiangen1016 picture jiangen1016  路  16Comments

pkoecker picture pkoecker  路  16Comments

0-gravity picture 0-gravity  路  28Comments