At the kendo version v2013.1.514, the NumericTextBox has an error in language de-DE.
You can test it at http://demos.kendoui.com/web/globalization/index.html
1. Change culture de-DE
2. Set "Initial price" to "10,5"
3. Focusout textbox, value change to "10,50 €"
4. Focus textbox, value change to "11.5" (problem is the point)
5. Focusout textbox, value change to "105,00 €"
I have change the NumericTextBox.prototype._update and it works... Have you a better idea?
(function () {
NULL = null;
round = kendo._round;
window.kendo.ui.NumericTextBox.prototype._update = function (value) {
var that = this,
options = that.options,
format = options.format,
decimals = options.decimals,
culture = that._culture(),
numberFormat = that._format(format, culture),
isNotNull;
if (decimals === NULL) {
decimals = numberFormat.decimals;
}
value = that._parse(value, culture);
isNotNull = value !== NULL;
if (isNotNull) {
value = parseFloat(round(value, decimals));
}
that._value = value = that._adjust(value);
that._placeholder(kendo.toString(value, format, culture));
if (isNotNull) {
value = value.toString();
if (value.indexOf("e") !== -1) {
value = round(+value, decimals);
}
} else {
value = "";
}
that.element.val(kendo.toString(parseFloat(value), format, culture)).attr("aria-valuenow", value);
}
})()
Thanks
You can test it at http://demos.kendoui.com/web/globalization/index.html
1. Change culture de-DE
2. Set "Initial price" to "10,5"
3. Focusout textbox, value change to "10,50 €"
4. Focus textbox, value change to "11.5" (problem is the point)
5. Focusout textbox, value change to "105,00 €"
I have change the NumericTextBox.prototype._update and it works... Have you a better idea?
(function () {
NULL = null;
round = kendo._round;
window.kendo.ui.NumericTextBox.prototype._update = function (value) {
var that = this,
options = that.options,
format = options.format,
decimals = options.decimals,
culture = that._culture(),
numberFormat = that._format(format, culture),
isNotNull;
if (decimals === NULL) {
decimals = numberFormat.decimals;
}
value = that._parse(value, culture);
isNotNull = value !== NULL;
if (isNotNull) {
value = parseFloat(round(value, decimals));
}
that._value = value = that._adjust(value);
that._placeholder(kendo.toString(value, format, culture));
if (isNotNull) {
value = value.toString();
if (value.indexOf("e") !== -1) {
value = round(+value, decimals);
}
} else {
value = "";
}
that.element.val(kendo.toString(parseFloat(value), format, culture)).attr("aria-valuenow", value);
}
})()
Thanks