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

NumericTextBox doesn't update ng-model (AngularJS)

5 Answers 60 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 06 Jul 2015, 05:34 AM

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? 

 

 

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 06 Jul 2015, 11:03 AM
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!
 
0
Justin
Top achievements
Rank 1
answered on 06 Jul 2015, 10:25 PM

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

 

0
Justin
Top achievements
Rank 1
answered on 06 Jul 2015, 10:27 PM

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?

0
Justin
Top achievements
Rank 1
answered on 06 Jul 2015, 10:41 PM

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. 

0
Justin
Top achievements
Rank 1
answered on 06 Jul 2015, 11:53 PM

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

 

 

Tags
NumericTextBox
Asked by
Justin
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Justin
Top achievements
Rank 1
Share this question
or