Hello,
I am building a grid with a complex datatype. Example below.
I am trying to do some custom validation, but it is not working. It doesn't even seem like it is hitting it.
If I do it on the 'LegacyID' field, which is the only not 'complex' field, it works perfectly fine.
Am I missing something? Doing something wrong?
schema: {
model: {
id:
'LegacyID'
,
fields: {
LegacyID:{type:
'number'
, editable:
false
},
Clean:{
ID: { type:
'number'
},
JobID: { type:
'number'
},
ProcessFlag: { type:
'string'
},
OverallStatus: { type:
'string'
},
LastRecordUpdater: { type:
'string'
},
LastUpdatedDateTime: { type:
'date'
},
CleansingComments: { type:
'string'
},
MaterialNumber: {
type:
'string'
,
validation: {
custom:
function
(input) {
console.log(input);
if
(input.val().length > 18) {
input.attr(
"data-maxlength-msg"
,
"SAP Material Number cannot exceed 18 characters."
);
return
false
;
}
return
true
;
}
},
},
MaterialBaseNumber: { type:
'string'
}
}
},