Posted 7 May 2019, 12:51 pm EST
I would like the ability to format input from the user as they type, similar to the following:
https://jsfiddle.net/rafj3md0/
In this example, I want to limit input to numbers only and format the input to a phone number as the user types in a flexsheet cell, or perhaps regex the input to be a valid email.
I would like the ability to have different validation types. I intend to store an array of cells I want to format (or have the ability to mark the cell formatter of flexsheet somehow?) to apply my desired validation on a per cell basis.
for example:
this.validateCells.push({
validationType: 'Phone',
sheetIndex: 3,
columnNumber: '1',
rowNumber: '2'
},
{
validationType: 'Email',
sheetIndex: 3,
columnNumber: '1',
rowNumber: '3'
});
I understand this is two different steps, one is validating on key up to format the string, the other is doing a addClass(e.cell, ‘wj-state-invalid’) to show invalid email. I wasn’t able to identify a flexsheet handler that could do this however and figured it was worth asking if any of this functionality was built in.
Thanks.