NumericTextBox doesn't update ng-model (AngularJS)

6 posts, 0 answers
  1. Justin
    Justin avatar
    7 posts
    Member since:
    Mar 2015

    Posted 06 Jul 2015 Link to this post

    I've created the issue at: http://dojo.telerik.com/irune

     If you click the spinners or enter a number it doesn't update the model. 

     If you adjust the sliders it will update the model and show in the numeric text box. 

     I'm trying to create a conditional widget but it's not picking up changes. 

     

    The same thing seems to happen with kendo drop down list.... 

     

    any ideas? 

     

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 06 Jul 2015 Link to this post

    Hello Justin,

    The "ng-if" directive will "remove or recreate a portion of the DOM tree based on an {expression}", which is not optimal for a widget and we cannot guarantee that it will not break the functionality of the control, mainly because the widget will be recreated each time a value is changed.

    However, since the "ng-show" has the same logic as the "ng-if" (in regards of displaying an element) and it is supported, you can use that directive instead:
    Hope this helps.


    Regards,
    Konstantin Dikov
    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. Justin
    Justin avatar
    7 posts
    Member since:
    Mar 2015

    Posted 06 Jul 2015 in reply to Konstantin Dikov Link to this post

    Great thanks for that. 

     is ng-disabled supported as well? 

     

    I was trying with your demo - it works -nearly if you put the ng-disabled on the input element itself, but if you are pushing the spinners you can set one to a number and then set the other one before it is disabled. 

     Try it yourself: 

     

    http://dojo.telerik.com/oRUqa

     

  5. Justin
    Justin avatar
    7 posts
    Member since:
    Mar 2015

    Posted 06 Jul 2015 in reply to Justin Link to this post

    In fact I think you can do this with any kendo ui widget. 

     

    If you set the value and the very next action is to click on another widget you can set that widget before it the ng-disabled or ng-show kicks in.  That shouldn't be the case right?

  6. Justin
    Justin avatar
    7 posts
    Member since:
    Mar 2015

    Posted 06 Jul 2015 in reply to Justin Link to this post

    I've found a work around. It's a little hacky but it gets the digest to run and disable the other widget. 

     To do this you use the ng-mouseenter & ng-mouseleave events on both widgets and set a valueTwoFocus = true as the expression. 

     

    I've updated the dojo: http://dojo.telerik.com/irune/11 to represent this. 

  7. Justin
    Justin avatar
    7 posts
    Member since:
    Mar 2015

    Posted 06 Jul 2015 in reply to Justin Link to this post

    Ahh so you use the k-on-spin to set the attribute on spin if required. This has fixed resolved it for me. 

     

     

Back to Top
Kendo UI is VS 2017 Ready