-
10 Mar 2008 2:00 AM #1
How to stop (cancel) 'deactivate' event on a TabPanelItem ?
How to stop (cancel) 'deactivate' event on a TabPanelItem ?
Hi guys !
I need to stop the propagation of the events if a condition is not satisfied when a tabPanelItem is deactivated.
I use this code :
But, as I read it in the documentation, the event is not given as parameter to the function that handles the "deactivate" action. So I can not code something like thatPHP Code:tab.on('deactivate', function(tabPanel, tabPanelItem) {
if (!wizard2view.saveCurrentPropertiesGroup(tabPanelItem.id, null)) {
// Cancel the event propagation
}
});
So, how can I do ?? I'm really lost ...PHP Code:e.cancel = true;
Thanx.
-
10 Mar 2008 2:20 AM #2
I've tryed that but it was not a success :
PHP Code:tab.on('deactivate', function(tabPanel, tabPanelItem) {
if (!wizard2view.saveCurrentPropertiesGroup(tabPanelItem.id, null)) {
return false;
}
});


-
10 Mar 2008 2:53 AM #3
I've found a solution. Instead of catching the 'deactivate' event on the tabPanelItem, I've coded that :
where wizard2view.jtabs is a TabPanel.PHP Code:wizard2view.jtabs.on('beforetabchange', function (tabPanel, e, tabPanelItem) {
if (tabPanel.getActiveTab() && tabPanel.getActiveTab().id != 'treeContentPanel') {
if (!wizard2view.saveCurrentPropertiesGroup(tabPanel.getActiveTab().id, null)) {
e.cancel = true;
}
}
});
The model event is strange on this point, i guess.
Thanx guys.


Reply With Quote