SMART datagrid v.1 > Examples

Back  Forward

Text Cell Editors  Example

SMART datagrid module provides two cell editors such as LineCellEditor and MultiLineCellEditor. Cell editor is set through DataColumn.editor property. You can simply set the editor type with texts, or transfer the editor properties together with the editor type. Please refer to editor help topic. 

1. Single Line CellEditor

LineCellEditor is an editor which can input a line of text. When set DataColumn.editor, if specify the type as "line" or do not specify at all, this editor will be used. Editing will be completed when type enter key and cancelled when type esc key. You can specify the maximum length that can be entered through maxLength

The maximum length of the editor in the selected column. 

And, you can also specify the input case through textCase

Text Input Case:
Column Text Case:

If textCase of the editor is default, it will follow column textInputCase

Grid - 1
0 rows
2. Multi Line CellEditor

MultiLineCellEditor is an editor which can input multiple lines of text. The type is specified as "multiline" when set DataColumn.editor

Code -1
    column.setEditor({
        type: "multiline",
        maxLength: 200
    });
    column.setStyles({
        textWrap: DataLudi.TextWrap.EXPLICIT
    });

If type shift+enter key, the line will be divided. Editing will be completed when type enter key and cancelled when type esc key. 

It has the same properties as LineCellEditor. In the example below, "Product name" column has been set by this editor. But be warned, the line will be divided only if set textWrap style value of the column as TextWrap.NORMAL or EXPLICIT

Grid - 2
0 rows

View Source JSP 

See Also
LineCellEditor
MultiLineCellEditor
DataColumn.editor
EditOptions
GridBase.editOptions
Examples
List Cell Editors
Number Cell Editor
Date Cell Editor
Cell Editing