MaskCellEditor included in SMART datagrid module, is the cell editor of limiting user input through special format of limited length and can be used in many ways. Mask Cell Editor specifies edit format through mask property.
Format string consists of Special Characters of specifying input range and Literal Characters of displaying the characters in the editor. In the tables below, there are Format Characters which are read and handled specially.
Characters | Inputtable Characters | Explanation | Example |
---|---|---|---|
'0' | '0' ~ '9' | Must enter Number | 000000-0000000 |
'9' | '0' ~ '9', space | Number or Space | 999-0000-0000 |
'#' | '0' ~ '9', '-', '+', space | Number, Symbol or Space | ###-0000 |
'L' | 'A' ~ 'Z', 'a' ~ 'z' | Must enter Letter | LLL-000-00 |
'?' | 'A' ~ 'Z', 'a' ~ 'z', space | Letter or Space | LLL-000-?? |
'A' | 'A' ~ 'Z', 'a' ~ 'z', '0' ~ '9' | Must enter Letter or Number | AAA-0000 |
'a' | 'A' ~ 'Z', 'a' ~ 'z', '0' ~ '9', space | Letter, Number or Space | aaa-0000-aaa |
If do not enter in the specified location and enter space key, both will be considered as 'Space'. There are many options like removing empty location or saving after trimming in the editor.
Characters | locale key | Explanation | Example |
---|---|---|---|
'.' | decimalSep | Decimal Point | 000.00 |
'/' | dateSep | Date Separator | 0000/00/00 |
':' | timeSep | Time Separator | 00:00:00 |
Delimiters are Literal characters rather than Format characters. Although Literal characters including basic delimiters are not saved as cell values, there is an option to save delimiters together in the editor.
In the table below, it has listed Substitute Characters of using special characters or delimiters as literal characters and Control Characters of converting the entered characters during the run time.
Characters | Explanation | Example |
---|---|---|
'\' | Read Format characters as Literal characters rather than Special characters until the next '\'. | \A\LL-000 |
'{' | Convert to password characters until the next '}'. | 000000-{0000000} |
'>' | Convert to uppercase characters until the next '>'. | >LLL>-<LLL< |
'<' | Convert to uppercase characters until the next '<'. | >LLL>-<LLL< |
grid.setColumns([{
name: 'colId',
editor: {
type: 'mask',
mask: '000-LL-000'
}
},
...
]);