SMART datagrid v.1 > Concepts

[ grids ver.1.3.5]   Back  Forward

Concepts.Edit Mask  Preparing...

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. 

Table-1  Mask type characters of limiting input range
CharactersInputtable CharactersExplanationExample
'0''0' ~ '9'Must enter Number000000-0000000
'9''0' ~ '9', spaceNumber or Space999-0000-0000
'#''0' ~ '9', '-', '+', spaceNumber, Symbol or Space###-0000
'L''A' ~ 'Z', 'a' ~ 'z'Must enter LetterLLL-000-00
'?''A' ~ 'Z', 'a' ~ 'z', spaceLetter or SpaceLLL-000-??
'A''A' ~ 'Z', 'a' ~ 'z', '0' ~ '9'Must enter Letter or NumberAAA-0000
'a''A' ~ 'Z', 'a' ~ 'z', '0' ~ '9', spaceLetter, Number or Spaceaaa-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. 

Table-2  Delimiters
Characterslocale keyExplanationExample
'.'decimalSepDecimal Point000.00
'/'dateSepDate Separator0000/00/00
':'timeSepTime Separator00: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. 

Table-3  Substitute and Control Characters
CharactersExplanationExample
'\'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<
Code -1
    grid.setColumns([{
        name: 'colId',
        editor: {
            type: 'mask',
            mask: '000-LL-000'
        }
    },
    ...
    ]);
See Also
MaskCellEditor
mask
GridStyles.textFormat
Examples
Mask Editor