require(["dijit/registry", "dojo/on", "dojo/ready", "dojo/domReady!"], function (registry, on, ready) {
ready(function () { //wait till dom is parsed into dijits
var panel = registry.byId('mainTab'); //get dijit from its source dom element
on(panel, "Click", function (event) { //for some reason onClick event doesn't work
alert(panel.selectedChildWidget.id);
});
});
});
3条答案
按热度按时间kq4fsx7k1#
您需要连接到_transition事件。
其中“tabs”是您的标签容器。
bxfogqkk2#
下面是一个在Dojo 1.8中工作的完整代码示例,我已经测试过它:
s1ag04yj3#
正确的Dojo 1.7+应该是;
另一种方式可以是