update existing tab

  1. #1

    update existing tab

    hi

    I was wondering if we can suggest best way to do this. I am using following code
    Say I have created some tabs and now for one tab I would like to update/refresh an existing tab. Should I add some code to the Javascript function below or is it something I should do in the .ashx file. Is it possible to update the tab or I should remove the tab and then add it again.

    
    
    
    var hlClick2 = function(href, id, curpanel) {
    
    
    var tab = CenterPanel.getComponent(id);
    
    
    if (tab) 
    
    
    {
    
    
    CenterPanel.setActiveTab(tab);
    
    
    } else {
    
    
    Ext.Ajax.request({
    
    
    url: 'URLLoader.ashx',
    
    
    success: function(response) { eval(response.responseText); },
    
    
    failure: function(response) {
    
    
    Ext.Msg.alert('Failure', 'Can not load current tab:\n' + response.responseText);
    
    
    },
    
    
    params: { id: id, url: href, tabId: CenterPanel.id, currentpanel: curpanel }
    
    
    });
    
    
    }
    
    
    }
  2. #2

    RE: update existing tab

    Hi,

    try to use an DIV to do this.

    example:

    1 - JavaScript function to update the div

    
    
    
    <script type="text/javascript">
    
        var addhtml = function(tab, sUrl) {
        var div = &#100;ocument.getElementById("divTab2");
    
        if (div) {
    
            var str_html = "<iframe width='100%' height='100%' src='" + sUrl + "' frameborder='0'></iframe>";
            div.innerHTML=str_html
            tab.show();
    
        }
    
        }
    </script>
    2 - Html tab souce code

    
    ....
    
    
    <ext:Button Text="Teste" runat="server" ID="Button1">
        <Listeners>
            <Click Handler="addhtml(#{Tab2},'test.aspx');" />
        </Listeners>
    </ext:Button>
    
    ....
    
    <ext:Tab ID="Tab2" runat="server" Title="Tab2" BodyStyle="background-color: transparent;">
    
    <Content>
    
        <div id="divTab2" style="width: 100%; height: 100%">
        
    
    
    </Content>
    
    </ext:Tab>
    
    ....
    This will recreate the div content.

  3. #3

    RE: update existing tab

    thanks. I will try that.
    idriss

Similar Threads

  1. Loop into an existing treepanel
    By springrider in forum 2.x Help
    Replies: 1
    Last Post: May 17, 2012, 3:46 AM
  2. Replies: 6
    Last Post: Mar 02, 2012, 1:39 PM
  3. [CLOSED] New window from an existing one.
    By GmServizi in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 09, 2010, 11:39 AM
  4. Replies: 2
    Last Post: Feb 16, 2010, 10:30 AM
  5. Mess with an existing application
    By zelegolas in forum 1.x Help
    Replies: 3
    Last Post: May 12, 2009, 3:50 PM

Posting Permissions