SMART datagrid v.1 > Classes

Back  Forward

DataLudi.NumberCellEditor  class

接受数字输入的单元格编辑器。 

基本上,限制只允许输入数字和',', '.', '+', '-', 'e', 'E'字符。 如果设置positiveOnlymaxDigits属性等,就可以更加以限制。 

Base Classes
TextCellEditor > CellEditor > EventAware > DLBase
Constructor
function NumberCellEditor (grid: GridBase, parentElement: HTMLElement);
Properties
checkMaxValue
maxDigits
maxValue
minValue
positiveOnly
scientific
Inherited Properties
CellEditor.booleanFormat
CellEditor.datetimeFormat
CellEditor.emptyValue
CellEditor.fontName
CellEditor.fontSize
CellEditor.keyCallback
TextCellEditor.maxLength
TextCellEditor.minLength
TextCellEditor.noHangul
TextCellEditor.text
CellEditor.textCase
Inherited Methods
EventAware.addListener
DLBase.assign
CellEditor.ctor
TextCellEditor.ctor
DLBase.getProperties
DLBase.getProperty
EventAware.removeListener
DLBase.setProperties
DLBase.setProperty
DLBase.toggle

 

Code -1
    var columns = [{
        name: "Quantity",
        fieldName: "Quantity",
        width: "100",
        editor: {
            type: "number",
            positiveOnly: true,
            maxValue:1000,
            minValue:50,
            emptyValue: 0,
            checkMaxValue: true
        }
    },
    ...
    ];
    grid.setColumns(columns);
See Also
DateCellEditor
Examples
数字单元格编辑器
单元格编辑