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

7 posts, 0 answers
  1. Piotr
    Piotr avatar
    7 posts
    Member since:
    Jan 2014

    Posted 26 Mar 2015 Link to this post

    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
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 27 Mar 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Piotr
    Piotr avatar
    7 posts
    Member since:
    Jan 2014

    Posted 27 Mar 2015 in reply to Boyan Dimitrov Link to this post

    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?
  5. Piotr
    Piotr avatar
    7 posts
    Member since:
    Jan 2014

    Posted 27 Mar 2015 in reply to Boyan Dimitrov Link to this post

    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?
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 31 Mar 2015 Link to this post

    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!
     
  7. Piotr
    Piotr avatar
    7 posts
    Member since:
    Jan 2014

    Posted 03 Jul 2015 in reply to Georgi Krustev Link to this post

    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

  8. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 06 Jul 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready