Data Grid - Column datatypes
Hi guys,
is there a way to accept only whole numbers? Right now the number datatype accepts decimals and I did not want that.
-
Hi Rodrigo,
Please use the below JavaScript code to ensure that only whole numbers are accepted for fields defined with the Number datatype.
eFormEvents.onFormLoadComplete = function() {
$('.k-grid-addNewRecord').click(function(e) {
var numericTextBox = $(e.currentTarget.parentElement.parentElement).find("input[data-role='numerictextbox']").data("kendoNumericTextBox");
numericTextBox.setOptions({decimals: 0, restrictDecimals: true, format: "n0"})
});
}Hope this helps!
Thanks
Please sign in to leave a comment.
Comments
1 comment