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

[kendo-angular] Bound value is reset after fetching datasource

5 Answers 141 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Piotr
Top achievements
Rank 1
Piotr asked on 26 Mar 2015, 09:00 AM
Hi,

the issue is that initial value set in the controller is reset to default one after fetching data items.

Example:
http://dojo.telerik.com/eMepO/10

Is that by design?

Best regards,
Piotr

5 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 27 Mar 2015, 10:05 AM

Hello Piotr,

Please use k-ng-model directive instead of only ng-model. I modified your example http://dojo.telerik.com/eMepO/13 and now it works fine. Here you can find more information about this change. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Piotr
Top achievements
Rank 1
answered on 27 Mar 2015, 02:16 PM
Hello,

This solution does not satisfy me because angular validation will not work properly with k-ng-model (which works perfectly with other kendo inputs that can use safely ng-model). For example adding ng-required='true' will not make form invalid if you do not select value in dropdown.

Why can not we use ng-model properly with kendo dropdowns?
0
Georgi Krustev
Telerik team
answered on 31 Mar 2015, 09:19 AM
Hello Piotr,

The k-ng-model directive was introduced, because ng-model sets/gets the value of the underlying input element directly instead using the value method of the widgets, which in some cases break the widget behavior.

In this particular case, the ng-model didn't work because of a bug in the DropDownList. The latest internal build seems to work as expected with ng-model too. I would suggest you upgrade to the latest internal build that is available in your Telerik account and let us know if the problem still persists.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Piotr
Top achievements
Rank 1
answered on 03 Jul 2015, 08:35 AM

Hello, the newest kendo version works fine with remote data source & ng-model. But if I will use local data source then I will have the same problem like before (adding option label will make it work)

See example:

http://dojo.telerik.com/eMepO/19

0
Boyan Dimitrov
Telerik team
answered on 06 Jul 2015, 12:54 PM

Hello Piotr,

 

Indeed this is a misbehavior and I logged it as a bug in GitHub. You can use the following link in order to track the issue progress. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Piotr
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Piotr
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or