I have set the validations on a column to be maxLen = 8000. I have traced the validation code in fn._digestNewRow to the point where it does the validations:
if (validate && column.validations) {
if (source == "edit" && allowInvalid === false) {
var objRet = this.isValid({
focusInvalid: true,
dataIndx: dataIndx,
rowIndx: rowIndx,
value: newVal
});
which eventually gets to this code in _isValidCell
var valid = valids[j],
on = valid.on,
type = valid.type,
_valid = false,
msg = valid.msg,
reqVal = valid.value;
if (on === false) {
continue
}
if (fn = pq.validations[type]) {
_valid = value == null ? false : fn(value, reqVal, getValue)
} else if (type) {
The issue is that with an empty text the value is null so the validation fails. I have verified above that type is maxLen and reqVal is 8000.
I will say this is somewhat erratic as I have seen cases where it does not generate the error although in most cases it is happening for us. I assume when it succeeds the value is an empty string instead of null.
The column definition is as follows:
dataIndx: "Notes"
dataType: "html"
doExpand: true
doFlex: true
editModel: {clicksToEdit: 1, saveKey: "", keyUpDown: false}
editable: true
editor:
attr: "rows=6"
select: true
type: "textarea"
render_Notes: ƒ (grid, ui)
title: "Notes"
validations: Array(1)
0:
msg: "Maximum length is 8000"
type: "maxLen"
value: 8000