We habe to use an old Dojo Version 1.1.x, our problem is to find an event fired when an Tab is changed (user leaving the tab).
Scenario: There is a Form inside an Tab, data is edited and the tab is left without saving, now we are looking for an way to prevent this.
dojo.connect(this.myTabPoint, "onShow", function(evt){
alert('X');
});
Works fine, but so we have to implement the check on every other tab (;
In Dojo 1.1.2 there is a method
_hideChild(/*Widget*/ page)indijit.layout.StackContainer(i.e. the superclass ofdijit.layout.TabContainer), which will invokeonHidemethod of page/tab (e.g.ContentPane) if it exists.The problem is there is no
onHidemethod indijit.layout.ContentPane, so you should addonHidestub method to ContentPane somewhere early in your code:Then all you need to do is
dojo.connecttoonHidemethod on a particular tab/ContentPane: