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

Numbers inline editing

5 Answers 1206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 2
Igor asked on 22 Jul 2012, 01:03 PM
Hello,
my project uses the code snippet from the following example to construct the kendo grid:
http://demos.kendoui.com/web/grid/editing-inline.html 

when clicking the "Edit" button to edit the "Units in Stock" value, i dont need to allow real numbers but only integers in the editor.
UnitsInStock: { type: "number", validation: { min: 0, required: true } }

What is the editor template do i need to append here to strict kendoUI grid input only integer values in this column?
Thank you!

5 Answers, 1 is accepted

Sort by
0
Igor
Top achievements
Rank 2
answered on 22 Jul 2012, 01:08 PM
I solved the problem, i've just had to add this:
format: "{0:d}"
in the column definition.
0
Igor
Top achievements
Rank 2
answered on 23 Jul 2012, 09:39 AM
Ah, when the value is "0",  it will show "d" instead... What gives?
0
Accepted
Georgi Krustev
Telerik team
answered on 24 Jul 2012, 02:46 PM
Hello Igor,

Currently the number formatting of the KendoUI does not support "d" format. You can find more information about formatting here. I believe that you can use "{0:n0}", which will format numbers as integers.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Igor
Top achievements
Rank 2
answered on 24 Jul 2012, 02:48 PM
Georgi, thanks!
It works for me
0
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 11 Oct 2012, 06:44 PM
Where is it that I am supposed to add the format: "{0:n0}"? I have it in my model and on my column and every combination thereing, but it still lets me type in decimals.
Tags
Grid
Asked by
Igor
Top achievements
Rank 2
Answers by
Igor
Top achievements
Rank 2
Georgi Krustev
Telerik team
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or