cblin
4 Oct 2010, 1:01 AM
At the moment, I am trying to implement a feature request that says "if a form is edited, the user must not be able to leave the form without a warning message if he did not use one of the 2 buttons (save or cancel)"
The warning message is something like "Are you sure to leave the current form without saving modifications ?" -> yes/no
If the user says yes (he is sure to lose his modifications), we must continue the screen workflow otherwise we must stay on the current screen.
The conclusion I made from my current investigations is that ExtJs provide no way to help me because there is no beforelostfocus event on the Panel
So, for a tabpanel, I have to be aware of beforetabchange so that if the user says yes I must manually activate the panel that was going to be activated
So, for a gridpanel, I have to be aware of selModel.beforerowselect or beforecellselect
So basically my current solution is to implement a plugin with a singleton that knows which component is edited and so I can make my best to return false on the given events.
Is there a better way ?
The warning message is something like "Are you sure to leave the current form without saving modifications ?" -> yes/no
If the user says yes (he is sure to lose his modifications), we must continue the screen workflow otherwise we must stay on the current screen.
The conclusion I made from my current investigations is that ExtJs provide no way to help me because there is no beforelostfocus event on the Panel
So, for a tabpanel, I have to be aware of beforetabchange so that if the user says yes I must manually activate the panel that was going to be activated
So, for a gridpanel, I have to be aware of selModel.beforerowselect or beforecellselect
So basically my current solution is to implement a plugin with a singleton that knows which component is edited and so I can make my best to return false on the given events.
Is there a better way ?