how to close the tabpanel's tab?

  1. #1

    how to close the tabpanel's tab?

    hi,
    how to use the menu to close the tab of the tabpanel?
    example: close this tab,close other tab, close all closable tab ...

    who can help me...


    use the menu to close the tab...

    like :
    <ext:TabPanel ID="tplBody" runat="server" ActiveTabIndex="0" Border="false" Title="Center" EnableTabScroll="true">
        <Listeners>
              <ContextMenu Handler="#{MOper}.tab = tab; #{MOper}.showAt(e.getPoint()); setItemId(#{tplBody}.itemId)"/>
        </Listeners>
    </ext:TabPanel>
    
     <ext:Menu runat="server" ID="MOper">
            <Items>
                <ext:MenuItem ID="closeTab" runat="server" Text="Close Tab" Icon="Add">
                    <DirectEvents>
                        <Click OnEvent="Close_Tab">
                            <ExtraParams>
                                <ext:Parameter Mode="Raw" Name="itemId" Value="getItemId()"></ext:Parameter>
                            </ExtraParams>
                        </Click>
                    </DirectEvents>
                </ext:MenuItem>
                <ext:MenuItem ID="closeOtherTab" runat="server" Text="Close OtherTabs" Icon="Add">
                    <DirectEvents>
                        <Click OnEvent="Close_OtherTabs">
                        </Click>
                    </DirectEvents>
                </ext:MenuItem>
                <ext:MenuItem ID="closeAllTab" runat="server" Text="Close AllTabs" Icon="Anchor">
                    <DirectEvents>
                        <Click OnEvent="Close_AllTabs">
                        </Click>
                    </DirectEvents>
                </ext:MenuItem>
            </Items>
        </ext:Menu>

    how :
    public void Close_OtherTabs(object sender, DirectEventArgs e)
            { }
    Last edited by zg_ivan; Dec 13, 2010 at 5:27 AM.
  2. #2
    Hi,

    You can call the .close() function on any Panel.

    Example

    Panel1.close();
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    Hi zg_ivan,

    I see this is your first post on Ext.Net forums. When you have a chance please read the following guide:
    http://forums.ext.net/showthread.php...ing-New-Topics

Similar Threads

  1. How to close tab on dblclick in tabpanel?
    By nanlinfeixue in forum 1.x Help
    Replies: 3
    Last Post: Jan 23, 2013, 4:01 AM
  2. How to close all tabs in TabPanel
    By ozayExt in forum 1.x Help
    Replies: 3
    Last Post: Apr 27, 2012, 11:48 AM
  3. [CLOSED] Cannot cancel tab close in TabPanel
    By Fredrik in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 14, 2012, 12:58 PM
  4. How to close tabpanel's tab in other window
    By fenya_616 in forum 1.x Help
    Replies: 1
    Last Post: Aug 05, 2010, 7:19 PM
  5. Can a Tab close itself from TabPanel?
    By ydnah2 in forum 1.x Help
    Replies: 2
    Last Post: Aug 10, 2009, 7:17 AM

Posting Permissions