Is there way to format the values and input field of the ComboBox widget?
Essentially I'd like a merged combobox/numeric textbox...
1 Answer, 1 is accepted
1
Alexander Valchev
Telerik team
answered on 18 Feb 2013, 02:54 PM
Hello Alexander,
ComboBox widget does not support formatting out of the box. If you want to achieve such behaviour you may hook up to the change event of the ComboBox and format the value manually. As an example:
<input id="combo" />
<script>
$("#combo").kendoComboBox({
change: function (e) {
var value = parseFloat(this.value()); //parse value
if(!isNaN(value)) { //if is number
value = kendo.format("{0:n2}", value); //format it
this.value(value); //set it as a value
} else {
this.value(""); //clear the value
}
}
})
</script>
I hope this information will help.
Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!