<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic TabContainer hide tabs by title in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246424#M14854</link>
    <description>&lt;P&gt;WAB 2.19&lt;/P&gt;&lt;P&gt;JS 3.x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inherited a custom widget that has TabContainer implemented and attempting to hide tabs by title.&amp;nbsp; Removing the TabContainer altogether isn't an option as there is a ton of js that would have to be reworked and prefer to just have a simple loop to hide elements.&lt;/P&gt;&lt;P&gt;I'm able to setup a loop over the tabs and successfully evaluate on title but not able to apply the correct method to hide the tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; _initTabContainer: function() {
        var tabs = [];
        tabs.push({
          title: 'Water Use',
          content: this.tabNode1
        });
        tabs.push({
          title: 'ERP',
          content: this.tabNode2
        });
        tabs.push({
            title: 'OKEE',
            content: this.tabNode3
        });
        tabs.push({
            title: 'ERC',
            content: this.tabNode4
        });
        
		this.selTab = 'ERP';

        this.tabContainer = new TabContainer({
          tabs: tabs,
          selected: this.selTab
        }, this.tabIdentify);
        this.tabContainer.startup();
   
        //this is where I'm attempting to hide tabs
		for (var i = 0; i &amp;lt; this.tabContainer.tabs.length; i++) { 
			if (this.tabContainer.tabs[i].title == 'Water Use'){
				this.tabContainer.tabs[i].style.display ='none' //error: Cannot set properties of undefined (setting 'display')				
			}
			
		}
        
        this.own(on(this.tabContainer, 'tabChanged', lang.hitch(this, function (title) {
            if (title == 'ERP') {
                this.currentTab = 'ERP'}
            else if (title == 'Water Use'){
                this.currentTab = 'WU'
            }
            else if (title == 'OKEE'){
                this.currentTab = 'OKEE'
            }
            else if (title == 'ERC') {
                this.currentTab = 'ERC'
            }
            
        })));
        utils.setVerticalCenter(this.tabContainer.domNode);
      },&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 09 Jan 2023 14:22:14 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2023-01-09T14:22:14Z</dc:date>
    <item>
      <title>TabContainer hide tabs by title</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246424#M14854</link>
      <description>&lt;P&gt;WAB 2.19&lt;/P&gt;&lt;P&gt;JS 3.x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inherited a custom widget that has TabContainer implemented and attempting to hide tabs by title.&amp;nbsp; Removing the TabContainer altogether isn't an option as there is a ton of js that would have to be reworked and prefer to just have a simple loop to hide elements.&lt;/P&gt;&lt;P&gt;I'm able to setup a loop over the tabs and successfully evaluate on title but not able to apply the correct method to hide the tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; _initTabContainer: function() {
        var tabs = [];
        tabs.push({
          title: 'Water Use',
          content: this.tabNode1
        });
        tabs.push({
          title: 'ERP',
          content: this.tabNode2
        });
        tabs.push({
            title: 'OKEE',
            content: this.tabNode3
        });
        tabs.push({
            title: 'ERC',
            content: this.tabNode4
        });
        
		this.selTab = 'ERP';

        this.tabContainer = new TabContainer({
          tabs: tabs,
          selected: this.selTab
        }, this.tabIdentify);
        this.tabContainer.startup();
   
        //this is where I'm attempting to hide tabs
		for (var i = 0; i &amp;lt; this.tabContainer.tabs.length; i++) { 
			if (this.tabContainer.tabs[i].title == 'Water Use'){
				this.tabContainer.tabs[i].style.display ='none' //error: Cannot set properties of undefined (setting 'display')				
			}
			
		}
        
        this.own(on(this.tabContainer, 'tabChanged', lang.hitch(this, function (title) {
            if (title == 'ERP') {
                this.currentTab = 'ERP'}
            else if (title == 'Water Use'){
                this.currentTab = 'WU'
            }
            else if (title == 'OKEE'){
                this.currentTab = 'OKEE'
            }
            else if (title == 'ERC') {
                this.currentTab = 'ERC'
            }
            
        })));
        utils.setVerticalCenter(this.tabContainer.domNode);
      },&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Jan 2023 14:22:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246424#M14854</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-01-09T14:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: TabContainer hide tabs by title</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246436#M14855</link>
      <description>&lt;P&gt;The TabContainer3&amp;nbsp; does have a removeTab method. Can you use that instead? It looks like you supply the title of the tab, from what I can tell from the code (found in client\stemapp\jimu.js\dijit\TabContainer3.js).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 14:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246436#M14855</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-01-09T14:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: TabContainer hide tabs by title</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246440#M14856</link>
      <description>&lt;P&gt;Thanks for the input -- I change TabContainer to TabContainer3 but don't see that it has any removeTab or remove method (probably not implementing correctly tho:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        this.selTab = 'Water Use';
        this.tabContainer = new TabContainer3({
          tabs: tabs,
          selected: this.selTab
        }, this.tabIdentify);
        this.tabContainer.startup();
		for (var i = 0; i &amp;lt; this.tabContainer.tabs.length; i++) { 
			if (this.tabContainer.tabs[i].title == 'Water Use'){
				this.tabContainer.tabs[i].removeTab();
				//this.tabContainer.tabs[i].style.display ='none' //error: Cannot set properties of undefined (setting 'display')				
			}			
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 15:13:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246440#M14856</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-01-09T15:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: TabContainer hide tabs by title</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246463#M14857</link>
      <description>&lt;P&gt;See if this works&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.tabContainer.removeTab('Water Use');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 15:45:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246463#M14857</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-01-09T15:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: TabContainer hide tabs by title</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246486#M14858</link>
      <description>&lt;P&gt;Yep!&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 16:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/tabcontainer-hide-tabs-by-title/m-p/1246486#M14858</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-01-09T16:02:44Z</dc:date>
    </item>
  </channel>
</rss>

