I am trying to implement some relatively complex validation/editing scenario. Datasource is client-only.
Requirements:
-
editing should be done per cell, since value in one cell affects possible values in other cell and/or combobox values that are dynamically set via setValueMap(). For this I use setValidateByCell(true) and setEditByCell(true), which seem to work
-
After exiting any editor, I have my validation EditorExitHandler with timer, which also seem to work:
listGrid.addEditorExitHandler(new EditorExitHandler() {
public void onEditorExit(EditorExitEvent event) {
final int row = event.getRowNum();
final int column = event.getColNum();
Object value = event.getNewValue();
if (listGrid.canEditCell(row, column) && value != null) {
handleEditorExit(event.getRecord(), row, column, value);
new Timer() {
public void run() {
if(listGrid.hasErrors()) {
listGrid.startEditing(row, column, false);
}
}
}.schedule(1);
}
}
});
The problem is that I need to set setStopOnErrors(true) for grid to display validation result. But, after setting this attribute, grid cells with combobox editors are no longer editable by mouse (you can still use up/down keys to select a value), which is really inconvenient.
One possible workaround for me would be to use validateCell, but it is not published in SmartGWT. Any particular reason for that?
Or, I can completely discard Validator framework and do anything manually in onEditorExit, but I am trying not to reinvent the wheel.
One more problem, even if the exclamation mark is displayed in grid, the error message will not show up when you move mouse over the icon. This works for forms. Is this a bug or a feature? ![]()
Any advice?
Thanks!