This sounds strange, but here's the use case:
The user is free to do any change, even when it leads to validation errors. They should be shown, but not block the user completing other fields.
grid properties:
saveAllEdits(true)
(default settings regarding validate)
uses a valuesManager, not a DataSource
I call
grid.startEditingNew(defaults) and the user does not fill in a required field at that time. Pressing Enter, ends edit mode, and the validator error icon comes up in the cell. That's OK.
When the user presses a save button, I want to do grid.getRowErrors(row) for all rows to show the error messages somewhere else to the user, preventing his save action.
But it seems that due to validation errors on the cells, the row is never saved to the grid records, and I can't see the new record in the grid.getDataAsRecordList().
I tried grid.setValidateOnChange(false) but still, when edit mode finishes, the row is validated, errors are shown in the cells, and editValues are not saved. That's probably because of setNeverValidate(false).
So I thought grid.setNeverValidate(true) which makes the editvalues to be saved OK, no errors are shown in the cells (bad side effect of course)
but calling grid.validateRow(row) myself never gives me a false. So in this case, I can't get the validators to do anything.
Any hints on what the correct settings should be?
thanks
The user is free to do any change, even when it leads to validation errors. They should be shown, but not block the user completing other fields.
grid properties:
saveAllEdits(true)
(default settings regarding validate)
uses a valuesManager, not a DataSource
I call
grid.startEditingNew(defaults) and the user does not fill in a required field at that time. Pressing Enter, ends edit mode, and the validator error icon comes up in the cell. That's OK.
When the user presses a save button, I want to do grid.getRowErrors(row) for all rows to show the error messages somewhere else to the user, preventing his save action.
But it seems that due to validation errors on the cells, the row is never saved to the grid records, and I can't see the new record in the grid.getDataAsRecordList().
I tried grid.setValidateOnChange(false) but still, when edit mode finishes, the row is validated, errors are shown in the cells, and editValues are not saved. That's probably because of setNeverValidate(false).
So I thought grid.setNeverValidate(true) which makes the editvalues to be saved OK, no errors are shown in the cells (bad side effect of course)
but calling grid.validateRow(row) myself never gives me a false. So in this case, I can't get the validators to do anything.
Any hints on what the correct settings should be?
thanks
Comment