SMART datagrid v.1 > Classes > MaskCellEditor

[ grids ver.1.3.5]   Back  Forward

DataLudi.MaskCellEditor.maskCallback  property

It will be called just before transferring data cell value to editor. 

If return the value which is not String like undefined from this callback, the returned string instead of data cell value will be transferred to editor. 

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

If want to change the value before transferring the edited value to data cell, you can use unmaskCallback

Defaults to null.

Getter
function maskCallback(): Function
Setter
function setMaskCallback(value: Function)
Code -1
    grid.setColumns([{
        fieldName: "fld0",
        editor: {
            type: "mask",
            mask: 'LLL-000',
            maskCallback: function (index, text) {
                // It will padding as '9' according to mask length.
                if (text.length < 6) {
                    return text + new Array(6 - text.length).join('9');
                }
            }
        },
        ...
    },
        ...
    ];
See Also
Edit Mask Overview
unmaskCallback
includeSeparators
includeLiterals
Examples
Mask Cell Editor