title | page_title | description |
---|---|---|
NumericTextBox |
Configuration, methods and events of Kendo UI NumericTextBox |
Code examples and tips how to configure NumericTextBox widget, use available methods and events. |
Represents the Kendo UI NumericTextBox widget. Inherits from Widget.
Specifies the culture info used by the widget.
<!--
TODO: Add the kendo.culture.de-DE.min.js file as it is required!
Here is a sample script tag:
<script src="http://kendo.cdn.telerik.com/{kendo version}/js/cultures/kendo.culture.de-DE.min.js"></script>
For more information check this help topic:
http://docs.telerik.com/kendo-ui/framework/globalization/overview
-->
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
culture: "de-DE"
});
</script>
Specifies the number precision. If not set precision defined by current culture is used.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
decimals: 1
});
</script>
Specifies the text of the tooltip on the down arrow.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
downArrowText: "Less"
});
</script>
Specifies the format of the number. Any valid number format is allowed.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
format: "c0"
});
</script>
Specifies the largest value the user can enter.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
max: 100
});
</script>
<input id="numerictextbox" max="100" />
<script>
$("#numerictextbox").kendoNumericTextBox();
</script>
Specifies the smallest value the user can enter.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
min: -100
});
</script>
<input id="numerictextbox" min="-100" />
<script>
$("#numerictextbox").kendoNumericTextBox();
</script>
The hint displayed by the widget when it is empty. Not set by default.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
placeholder: "Select A Value"
});
</script>
Specifies whether the up and down spin buttons should be rendered
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
spinners: false
});
</script>
Specifies the value used to increment or decrement widget value.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
step: 0.1
});
</script>
<input id="numerictextbox" step="0.1" />
<script>
$("#numerictextbox").kendoNumericTextBox();
</script>
Specifies the text of the tooltip on the up arrow.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
upArrowText: "More"
});
</script>
Specifies the value of the NumericTextBox widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
value: 10
});
</script>
<input id="numerictextbox" value="10" />
<script>
$("#numerictextbox").kendoNumericTextBox();
</script>
An object, which holds the options of the widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var options = numerictextbox.options;
<script>
Prepares the NumericTextBox for safe removal from DOM. Detaches all event handlers and removes jQuery.data attributes to avoid memory leaks. Calls destroy method of any child Kendo widgets.
Important: This method does not remove the NumericTextBox element from DOM.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
// detach events
numerictextbox.destroy();
<script>
Enables or disables the widget.
If set to true
the widget will be enabled. If set to false
the widget will be disabled.
<input id="numerictextbox" disabled="disabled" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.enable(true);
</script>
Toggles the readonly state of the widget. When the widget is readonly it doesn't allow user input.
There is a difference between disabled and readonly mode. The value of a disabled widget is not posted as part of a
form
whereas the value of a readonly widget is posted.
If set to true
the widget will not allow user input. If set to false
the widget will allow user input.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.readonly();
</script>
Focuses the widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.focus();
</script>
Gets or sets the max value of the widget.
The max value to set.
Number
The max value of the widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var max = numerictextbox.max();
console.log(max);
</script>
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var max = numerictextbox.max();
numerictextbox.max(10);
</script>
Gets or sets the min value of the widget.
The min value to set.
Number
The min value of the widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var min = numerictextbox.min();
console.log(min);
</script>
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var min = numerictextbox.min();
numerictextbox.min(10);
</script>
Gets or sets the step value of the widget.
The step value to set.
Number
The step value of the widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var step = numerictextbox.step();
console.log(step);
</script>
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var step = numerictextbox.step();
numerictextbox.step(0.5);
</script>
Gets or sets the value of the NumericTextBox.
The value to set.
Number
The value of the widget.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var value = numerictextbox.value();
console.log(value);
</script>
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
var value = numerictextbox.value();
numerictextbox.value(0.5);
</script>
Fires when the value is changed
The widget instance which fired the event.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
change: function() {
var value = this.value();
console.log(value); //value is the selected date in the numerictextbox
}
});
</script>
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.bind("change", function() {
var value = this.value();
console.log(value); //value is the selected date in the numerictextbox
});
</script>
Fires when the value is changed from the spin buttons
The widget instance which fired the event.
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
spin: function() {
var value = this.value();
console.log(value); //value is the selected date in the numerictextbox
}
});
</script>
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.bind("spin", function() {
var value = this.value();
console.log(value); //value is the selected date in the numerictextbox
});
</script>