[CLOSED] How can I add one item "Refresh" to the tab context menu?

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] How can I add one item "Refresh" to the tab context menu?

    I have a TabPanel Control in page. Each tab has a context menu with three items: Close Tab, Close Other Tabs, Close All Tabs.
    How can I add one item "Refresh" to the tab context menu?
    And How can I fire the "Refresh" event and refresh the tab content page?
    Thanks for your answer.

    Click image for larger version. 

Name:	截图00.jpg 
Views:	20 
Size:	11.0 KB 
ID:	6762
    Attached Thumbnails Click image for larger version. 

Name:	addTab.png 
Views:	23 
Size:	23.1 KB 
ID:	6761  
    Last edited by Daniil; Sep 12, 2013 at 3:01 PM. Reason: [CLOSED]
  2. #2
    Hello!

    You can use extraItemsTail: http://docs.sencha.com/extjs/4.2.1/#...extraItemsTail

    To fire event you can use fireEvent method: http://docs.sencha.com/extjs/4.2.1/#...thod-fireEvent

    However, I think it could be not necessary if you provide more details about your requirements.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:TabPanel runat="server">
                <Plugins>
                    <ext:TabCloseMenu runat="server">
                        <CustomConfig>
                            <ext:ConfigItem Name="extraItemsTail" Value="[{ 
                                text: 'New Menu Item',
                                listeners: {
                                    click: function() { 
                                        Ext.Msg.alert('Tab Click', 'Clicked');
                                    }
                                }
                            }]" Mode="Raw" />
                        </CustomConfig>
                    </ext:TabCloseMenu>
                </Plugins>
                <Items>
                    <ext:Panel runat="server" Title="Panel1"></ext:Panel>
                </Items>
            </ext:TabPanel>
        </form>
    </body>
    </html>
  3. #3
    Hi wangyi, did you resolved the issue? I'm trying to add a refresh button for each tab.
  4. #4

    Hi, I have solved the problem.

    <ext:ConfigItem Name="extraItemsTail" Value="[
                            { 
                                text: 'Refresh,
                                listeners: {
                                    click: function() {
    
                                        var currtab = App.TabPanel_Content.getActiveTab();
    
                                        if( currtab.title == 'Main' )
                                        {
                                            App.direct.RefrushPortal();
                                        }
                                        else
                                        {
                                            currtab.loader.load();
                                        }
                                    }
                                }
    Last edited by Daniil; Sep 05, 2013 at 2:19 PM. Reason: Please use [CODE] tags
  5. #5
    Hi wangyi. Thank you for your quick response. I cannot make it work. Could you please post more code?

    I may be close anyway with my current code:

    <ext:Panel 
                            ID="Tab1" 
                            runat="server" 
                            Title="Inicio" 
                            Icon="House"
                            BodyStyle="background-color: transparent;"
                            AutoScroll="true">
                            <TabMenu>
                                <ext:Menu ID="Menu1" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItem1" runat="server" Text="Reload">
                                            <DirectEvents>
                                                <Click OnEvent="Reload1" Type="Load"/>
                                            </DirectEvents>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </TabMenu>
                            <Content>
                                <ext:Container ID="Container1" runat="server">
                                    <Content>
                                        <uc1:Inicio ID="ucInicio" runat="server"/> 
                                    </Content>
                                </ext:Container>
                            </Content>
                        </ext:Panel>
    Public Sub Reload1(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
    
            Tab1.Reload()
    
        End Sub
    That doesn't reload the tab!
  6. #6
    Hi @jamesand,

    The Reload method makes sense only if you use a Loader.

    In your case, please try:
    Tab1.UpdateContent()
  7. #7
    Hi Daniil, I already tried it and it makes all my controls dissapear...
  8. #8
    Could you, please, provide a full test case to reproduce?
  9. #9
    No, I'm sorry. I tried it. But it has something to do with another tab cause it depends on what others tab contains that ir works or not.

    How the content of another tab can have an impact?
  10. #10
    Quote Originally Posted by jamesand View Post
    How the content of another tab can have an impact?
    Hard to say.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: May 31, 2013, 3:04 AM
  2. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  3. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  4. [CLOSED] Treegrid - best way to localize the grid menu item "Columns"
    By fordprefect in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 06, 2011, 2:57 PM
  5. Replies: 2
    Last Post: Jul 30, 2010, 12:37 AM

Tags for this Thread

Posting Permissions