Hi there, I found a patch was needed to avoid incorrect validators being applied to my ListGrid in SC 12.0. I tried to recreate this in your samples and I could not and can't invest anymore time. But, the patch is common-sense so I think you should consider applying it. Basically, the patch below shows that the editItem for the cell validator was the wrong edit item. This happened when the last cell the user entered was for an integer field in the third position in the grid it was applying the validator for that integer field to my boolean field in the first position in the grid. The patch below just confirms the field.name and the editItem.name are the same before applying the editItem.validators
Code:
isc.ListGrid.getPrototype().addProperties({ getCellValidators : function isc_ListGrid_getCellValidators(rowNum, colNum) { var field = this.getField(colNum); if (!field) return null; var itemValidators, fieldValidators = field.validators, editForm = this.getEditForm(); if (editForm) { var editItem = editForm.getItem(colNum); //patch to ensure the editItem field name and field name match before applying validators from the edit Item if (editItem && editItem.name==field.name) itemValidators = editItem.validators; } if (fieldValidators && itemValidators) { var combined = []; for (var i = 0; i < fieldValidators.length; i++) { var validator = fieldValidators[i]; if (!combined.contains(validator)) combined.add(validator); } for (var i = 0; i < itemValidators.length; i++) { var validator = itemValidators[i]; if (!combined.contains(validator)) combined.add(validator); } return combined; } return fieldValidators || itemValidators || null; } })
Comment