[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 addTab.png  
    Last edited by Daniil; Sep 12, 2013 at 4:01 PM. Reason: [CLOSED]
  2. #2

    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>
    <head runat="server">
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:TabPanel runat="server">
                    <ext:TabCloseMenu runat="server">
                            <ext:ConfigItem Name="extraItemsTail" Value="[{ 
                                text: 'New Menu Item',
                                listeners: {
                                    click: function() { 
                                        Ext.Msg.alert('Tab Click', 'Clicked');
                            }]" Mode="Raw" />
                    <ext:Panel runat="server" Title="Panel1"></ext:Panel>
  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' )
    Last edited by Daniil; Sep 05, 2013 at 3: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:

                            BodyStyle="background-color: transparent;"
                                <ext:Menu ID="Menu1" runat="server">
                                        <ext:MenuItem ID="MenuItem1" runat="server" Text="Reload">
                                                <Click OnEvent="Reload1" Type="Load"/>
                                <ext:Container ID="Container1" runat="server">
                                        <uc1:Inicio ID="ucInicio" runat="server"/> 
    Public Sub Reload1(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
        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:
  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, 4:04 AM
  2. Replies: 5
    Last Post: May 02, 2012, 6:37 PM
  3. Replies: 4
    Last Post: Oct 11, 2011, 3:42 AM
  4. Replies: 2
    Last Post: Oct 06, 2011, 3:57 PM
  5. Replies: 2
    Last Post: Jul 30, 2010, 1:37 AM

Tags for this Thread

Posting Permissions