This is a migrated thread and some comments may be shown as answers.

Show only integers in grid pop-up editor

2 Answers 316 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
AP
Top achievements
Rank 1
Iron
Iron
Veteran
AP asked on 10 Sep 2017, 02:23 PM

I have a grid pop-up editor defined, which uses a numeric textbox. I'm trying to get this to show only integers, but I'm not having any luck.
From other forum posts, data-format="0"  should work, but this breaks the grid, with an 'e.slice is not a function' error.
Currently it is defined as:-

<p><label>Year:</label><input type="text" name="Year" data-type="number" data-bind="value:Year" data-role="numerictextbox" data-spinners="false"  data-decimals="0"/></p>

 

This works fine, except shows two decimals.

If I change it to:-

<p><label>Year:</label><input type="text" name="Year" data-type="number" data-bind="value:Year" data-role="numerictextbox" data-format="0" data-spinners="false"  data-decimals="0"/></p>

 

The grid stops working, and the error is raised.

How can I get it to work?

2 Answers, 1 is accepted

Sort by
0
Accepted
Preslav
Telerik team
answered on 12 Sep 2017, 01:48 PM
Hello Andrew,

Based on the provided information, I believe that the correct format should be:

data-format="n0"

Additionally, more information about the Number Formatting is available in this article:

Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
AP
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 14 Sep 2017, 11:21 AM
Thanks, that worked
Tags
NumericTextBox
Asked by
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Preslav
Telerik team
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or