The numericTextBox control gets the old value, if one inputs a new number directly in the textbox field and then leaves the controls. It works only correctly, if the value is selected by spin buttons. I created a sample:
http://dojo.telerik.com/aTuBI
Am I doing something wrong?
2 Answers, 1 is accepted
0
Accepted
Georgi
Telerik team
answered on 24 Nov 2017, 07:58 AM
Hello Christian,
Thank you for the provided sample. I have examined it and noticed that the event handler is attached to the change event of the input element, not to the Kendo NumericTextBox.
e.g.
var numeric = $("#num").kendoNumericTextBox(); //this method initializes the widget but does not return the instance
numeric.bind("change", function (e) { alert("Value: " + $("#num").data("kendoNumericTextBox").value()) });
Should be:
var numeric = $("#num").kendoNumericTextBox().data('kendoNumericTextBox');
numeric.bind("change", function (e) { alert("Value: " + $("#num").data("kendoNumericTextBox").value()) });
I have modified the provided sample and now the correct value is displayed: