Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does dojo TabContainer have an event thats triggered when changing tabs?

does DOJO TabContainer have an event thats triggered when changing tabs?

I imagine it would but I couldn't find anything about it in the documentation. :(

SOLVED: It looks like I found a solution here:

Dijit TabContainer Events - onFocus

not the most searchable topic title :/

like image 588
Greg Avatar asked Dec 04 '22 03:12

Greg


1 Answers

Connect aspect.after to TabContainer's selectChild method:

var tabContainer1 = registry.byId("tabContainer1");

aspect.after(tabContainer1, "selectChild", function() {
    console.log("tab changed");        
});

Or if you are interested in a particular tab, connect to its ContentPane's _onShow:

var contentPane1 = registry.byId("contentPane1");

aspect.after(contentPane1, "_onShow", function() {
    console.log("[first] tab selected");        
});

See it in action at jsFiddle: http://jsfiddle.net/phusick/Mdh4w/

like image 147
phusick Avatar answered Dec 05 '22 16:12

phusick