We have just upgraded from version 10 to 14. In the process, we discovered that although the grid's crud service still returns true if the end cell editing event is cancelled, this return value is not passed back in the grid's endEdit method.
Knowing whether or not end cell editing has been cancelled is a critical part of our application's functionality. We absolutely cannot let the user proceed with other operations (navigating away from the page, printing the records, etc) if the cell is still in edit mode and the user's changes have not been persisted.
Please restore the return value for endEdit as soon as possible
Hello,
I have been looking into your question, however, I'm not sure I understood your requirement completely.
I have tested the behavior of the grid when the cellEdit event is canceled and the page is changed in both version 10 and 14. The observed behavior in version 10 is that the edited cell remains in the view, however, the rest of the fields are not from this row.
In version 14 when the page is changed the cell exits edit mode and the changes are not committed. However, preventing certain interactions could be achieved on application level. Since the event is canceled on some conditions through the code, an approach I could suggest is to store the event.cancel value in a global variable and then you could prevent the required actions depending on this value.
For example, I have prepared a sample where paging is prevented when the cellEdit event is canceled via the paging event and it could be found here.
Using a similar approach you could prevent other actions based on the same global variable.
Please test the sample above on your side and let me know how it behaves. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with steps to reproduce.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
Thank you for your cooperation.
Looking forward to hearing from you.
Regards,Teodosia HristodorovaSoftware Developer
Sorry, it appears that the problem has been misunderstood.
This is not about what happens in the grid UI, it is about what happens when I programatically ask the grid to end editing using grid.endEdit() method.
In previous releases, this method would return true if the endCellEditing event was cancelled. This event can be cancelled for any number of reasons including validation failure.
We must ask the grid to end editing in numerous circumstances such as when a user wants to print a report. If the end edit request is cancelled and just prints the report without saving the value of the cell they are currently editing, then the information in the report will not match what the user is seeing on the screen which could potentially result in a significant financial error for the customer.
What we are asking for is the restoration of the return value to grid.endEdit in the event the endCellEditing event is cancelled.