Operator when switching tab, often misuse, resulting tab is closed, and can not be restored, made previous operation is lost.
The solution is to increase a close, that, to study the events under the TabPanel, may be used incident beforeclose, in the production of this event, it is the operation to confirm the entry point.
The key code is simple, the main principle is to add a tab to sign a listeners, listening to trigger the event, matching the event's name, if it is "beforeclose", the Executive Ext.MessageBox.show pop-up window of a question, ask for confirmation Close tab .
Note that: Ext.MessageBox.show occurred, and did not stop the run as window.confirm, so will continue to implement the following code.
Therefore, in order to avoid this situation, and after calling Ext.MessageBox.show, Ext the MessageBox pop up, but the process will continue to implement to return false, this would make the tab's close event is not triggered without being shut down, Implementation tab of the temporarily closed.
Asked the window when the user clicks "No" button, without any action on the line, as close event has not triggered;
Asked the window when the user clicks "Yes" button, to re-invoke the remove method of tabs to achieve closure tab.