SMART datagrid v.1 > Classes > MaskCellEditor

[ grids ver.1.3.5]   Back  Forward

DataLudi.MaskCellEditor.unmaskCallback  property

Callback function which changes the value of editor as the value to be saved. 

It is used when the default mask release function of editor is not appropriate. If return the value which is not String like undefined from this callback, it will use the default function of editor. And, if set this callback, it will not check whether the returned value is against mask format. 

function (index:CellIndex, text:String):String;

If want to change the value when transferring the data cell value to editor, you can use maskCallback

Defaults to null.

Getter
function unmaskCallback(): Function
Setter
function setUnmaskCallback(value: Function)
Code -1
    grid.setColumns([{
        fieldName: "fld0",
        editor: {
            type: "mask",
            mask: 'LLL-000',
            unmaskCallback: function (index, text) {
                if (!text || text.length < 7) {
                    return 'INVALID';
                }
                // In other cases, it will be unmasked by the default function of editor.
            }
        },
        ...
    },
        ...
    ];
See Also
Edit Mask Overview
maskCallback
includeSeparators
includeLiterals
Examples
Mask Cell Editor