[CLOSED] How to hide Tab bar in TabPanel if only 1 tab

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] How to hide Tab bar in TabPanel if only 1 tab

    How to hide Tab bar in TabPanel if only 1 tab
    Last edited by Daniil; Oct 31, 2013 at 6:57 AM. Reason: [CLOSED]
  2. #2
    Hi @kwcitadmin,

    Please clarify do you add and remove tabs on the fly or everything is configured initially?
  3. #3
    everything is configured initially
  4. #4
    If so, it is best to switch a TabPanel to a common Panel with FitLayout if there is the only tab.
  5. #5
    like this ?

    tabPanel = new Panel() ?

    any example?
  6. #6
    It depends on where do you create your Panel.

    In markup:

    <ext:Panel 
    	runat="server" 
            Layout="Fit">
    	...
    </ext:Panel>
    In Code-Behind:

    var panel = new Ext.Net.Panel()
    {
        Layout = "Fit"
    };
    Last edited by Baidaly; Oct 31, 2013 at 1:57 AM.
  7. #7
    like this?

            <ext:Viewport ID="mainView" runat="server" Layout="BorderLayout">
                <Items>
                    <ext:TabPanel ID="tabPanel" runat="server" Region="Center" Border="false" TabMenuHidden="true">
                        <Items>
                        </Items>
                    </ext:TabPanel>
                    <ext:Panel ID="singlePanel" runat="server" Region="Center" Layout="FitLayout" Hidden="true">
                        <Items>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
  8. #8
    Quote Originally Posted by kwcitadmin View Post
    like this?

            <ext:Viewport ID="mainView" runat="server" Layout="BorderLayout">
                <Items>
                    <ext:TabPanel ID="tabPanel" runat="server" Region="Center" Border="false" TabMenuHidden="true">
                        <Items>
                        </Items>
                    </ext:TabPanel>
                    <ext:Panel ID="singlePanel" runat="server" Region="Center" Layout="FitLayout" Hidden="true">
                        <Items>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
    You cannot have two Containers with Region="Center". If understood you correctly you need something like this:

    <ext:Viewport ID="mainView" runat="server" Layout="BorderLayout">
    	<Items>
    		<ext:Panel ID="singlePanel" runat="server" Region="Center" Layout="FitLayout" Hidden="true">
    			<Items>
    			</Items>
    		</ext:Panel>
    	</Items>
    </ext:Viewport>
    If it's not what you need provide more details and scenario.
  9. #9
    You should use a Panel instead of a TabPanel if there is the only tab, but not both together.
  10. #10
    Dear Support,

    I am sorry to confuse you. It is a dynamic interface

    page load :

    var items = getItemsFromDB();
    for each(var i in items) {
    addtab(tabPanel, i);
    }

    if (items.length == 1)
    hidetabbar(tabPanel)

    I am coding to do something like above code segment
Page 1 of 2 12 LastLast

Similar Threads

  1. hide and show panel runtime in a tabpanel
    By maxdiable in forum 2.x Help
    Replies: 0
    Last Post: Aug 26, 2013, 12:17 PM
  2. Show and hide Tabs in TabPanel error
    By slonati_adv in forum 2.x Help
    Replies: 1
    Last Post: Sep 16, 2012, 5:43 PM
  3. [CLOSED] TabPanel Show/Hide Panel
    By amitpareek in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 02, 2012, 3:21 PM
  4. TabPanel + Dynamic tab show/hide
    By reinaldo.designerdigital in forum 1.x Help
    Replies: 3
    Last Post: Feb 06, 2009, 12:26 PM
  5. [CLOSED] Tabpanel: hide tab from codebehind
    By haltenberg in forum 1.x Help
    Replies: 0
    Last Post: Jun 11, 2008, 12:33 PM

Posting Permissions