KendoUI Numeric box doesn't set ngModel correctly #240
Comments
This is contradictory with #135, #136, #152, as I mentioned. Some people expect the model to contain the “logical” value (i.e. a Date object instead of a string), and others expect the model to contain the string content of the input field. Currently we pass the value of the widget, and I see no way to make both sides happy. :-\ So in your case, the model is 3.33333333 because that's what |
:( is there a way to get value what's in widget to update the model manually then? |
You mean to get the value of the input field? |
Yes, so after it's "trimmed" to 3.3333, how can I bind that value to ng-model? I've tried with change function but in there value is still 3.3333333333.... |
You can just use jQuery, for example |
It seems to me that the operation mode that most Angular users would expect is to place in the model the value of the input field, as a string — but this breaks #135, #136 etc. I was suggesting in a comment there to do just that, and use something different for the |
I did this as workaround (I have a scope variable model : "=ngModel"):
While saying this, there is also an issue if you update ngModel from controller it doesn't reflect in input until you click in it so I also did:
to retrieve value back again so it's validated with kendoNumericTextBox where kendoNumericBox is return value of kendoNumericTextBox constructor:
|
Shall we close this as invalid then? |
If I initialize input box which has ngModel attached to it like this:
Now, I enter value:
in it and it gets displayed correctly (trimmed to 4 decimals):
but ngModel is still set to 3.33333333
The text was updated successfully, but these errors were encountered: