Is it possible to apply a regular expression to a igTextEditor within an igGrid Updating?
I attempted to utilize the validate option, but it was unsuccessful.
$("#schedulerTable").igGrid({
columns: $scope.schedulerColumns,
width: "87%",
height: "300px",
fixedHeaders: true,
autoGenerateColumns: false,
autofitLastColumn: true,
autoCommit: true,
renderCheckboxes: true,
responseDataKey: "results",
dataSource: $scope.schedulerData,
updateUrl: "",
primaryKey: 'Id',
features: [
{
name: "Updating",
generatePrimaryKeyValue: function (evt, ui) {
nextPrimarykey -= 1;
ui.value = nextPrimarykey;
},
enableAddRow: true,
enableDeleteRow: true,
editMode: "row",
columnSettings: [
{
columnKey: "Id",
editorType: "numeric",
editorOptions: {
readOnly: true
}
}, {
columnKey: "Time",
editorType: "text",
editorOptions: {
},
validatorOptions: {
regExp: /^[a-zA-Z]{1}[a-zA-Z0-9_\.\-]*\@\w{2,10}\.\w{1,10}$/,
onblur: true,
onchange: true
},
required: true,
validation: true,
defaultValue: "00:00"
},
{
columnKey: "Mo"
},
{
columnKey: "Tu"
},
{
columnKey: "We"
},
{
columnKey: "Th"
},
{
columnKey: "Fr"
}]
}]
});
I am aiming to implement a time picker in the Time Column, although this feature does not currently exist. Therefore, I am attempting to extract only the time using a regular expression in the textEditor. The grid is initially populated with columns labeled Time, Mo-Friday. When you click on "add" within the grid, you can enter a time in the input field. The time should be validated before clicking on "done" to display any error messages.
To preview how the table appears, visit: https://codepen.io/ablablabla/pen/PJLbJz