DOJO: Tab ordering in TabContainer
The tabContainer.getChildren( ) method returns a list of tab widget (ContentPane) in the container using the following way:
dijit.findWidgets(tabContainer.containerNode)
However, if you did some drag and drop actions on the tab button list to rearrange the tab ordering, the tab sequence did not changed actually. To get a modified / correct ordered list, you may try to override the getChildren( ) method:
myTabContainer.getChildren = function() {
var list = this.tablist.getChildren();
var rsltList = [];
for (var idx=0; idx<list.length; idx++) {
rsltList.push(list[idx].tab);
}
return rsltList;
}
Noticed the underlined "tab" member variable in the code, you need to manually assign it when your tab page is created. Or you may find a way / method to get the Tab page object (ContentPane) via the Tab Button.
If you got any better method, please let me know :-)
dijit.findWidgets(tabContainer.containerNode)
However, if you did some drag and drop actions on the tab button list to rearrange the tab ordering, the tab sequence did not changed actually. To get a modified / correct ordered list, you may try to override the getChildren( ) method:
myTabContainer.getChildren = function() {
var list = this.tablist.getChildren();
var rsltList = [];
for (var idx=0; idx<list.length; idx++) {
rsltList.push(list[idx].tab);
}
return rsltList;
}
Noticed the underlined "tab" member variable in the code, you need to manually assign it when your tab page is created. Or you may find a way / method to get the Tab page object (ContentPane) via the Tab Button.
If you got any better method, please let me know :-)
Comments
Post a Comment