Programatically Set tab content for a jimu/dijit/TabContainer3

1430
4
Jump to solution
09-15-2016 10:33 AM
Alexwang
Occasional Contributor II

Hello, I have a programatically created tab container in postCreate(). And I want to set the content to each tab via a button click. Please see below for code snippets. I used tabs[1].set(), but returned 'set is not a function error'.  Then I tried to assign to tabs[1].content, no error but didn't do anything. what is the correct way to set tabcontainer tab content programatically?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Alex,

   With TabContainer3 the only thing you can do is call selectTab method using the title of the tab after you have created your tabs.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Alex,

   The only places I ever see TabContainer3 used it is always created programatically and the tabs content is added in the constructor. There are no functions in the dijit to allow for adding content after creation.

0 Kudos
Alexwang
Occasional Contributor II

Thanks Robert! Ok, I'll re-arrange my codes to achieve my purpose. Another question, do you know how to programatically set the selected tab to a different tab other than the default left one when first start the tab container?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Alex,

   With TabContainer3 the only thing you can do is call selectTab method using the title of the tab after you have created your tabs.

Alexwang
Occasional Contributor II

Thanks Robert. .selectTab('tab title') worked. 

0 Kudos