SMART datagrid v.1 > Examples

[ grids ver.1.3.0]   Back  Forward

Number Cell Editor  Example

If specify type as "number" when set DataColumn.editor, you can use NumberCellEditor when edit the value of Data Field which Data Type is NUMBER

NumberCellEditor is a simple TextCellEditor which limits the input of numeric values with using keyboard. If positiveOnly is true, you cannot input negative numbers. And, if specify maxDigits below 0, you cannot input a decimal point. maxDigits greater than 0 is the number of decimal places which is capable of being input. There is no limit if do not specify or is NaN. 

In the grid below, positiveOnly is true in "Interest Rate" column. positiveOnly is true and maxDigits is 0 in "Original Amount" column. maxDigits is 2 in "Cancelled Amount" column. 

Even if set these limitations, the existing text will not be modified when display the editor. 

Grid - 1
rows

You can specify the minimum and maximum range transferred from the editor to the cell through NumberCellEditor.minValue and maxValue properties. In addition, if maxValue is not NaN and specify NumberCellEditor.checkMaxValue as true (the default value), it will restrict the user from entering more than the maximum value. 

 

View Source JSP 

See Also
NumberCellEditor
DataField
DataColumn.editor
EditOptions
GridBase.editOptions
Examples
Text Cell Editors
List Cell Editors
Date Cell Editor
Cell Editing