What is the command to close the grid editor programmatically without actually clicking on the cancel button?
Do you mean equivalent to Cancel, no saving, but programmatic, it is Grid.cancelEditor(). There is also Grid.saveEditor().
Because I override
Grid.doEditItem()
seems I must first call
super.doEditItem();
and then
super.cancelEditor();
(do not want the row to be edited if a condition is true).
Can you please also advise why after cancelEditor is called I need to double-click twice or 3 times for the editor to appear again on a valid line?
private class MyGrid extends Grid{
@Override
protected void doEditItem() {
super.doEditItem();
if (...) {
super.cancelEditor();
}
}
}