Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
How to remove/delete a tab?
posted

Hi,

How to remove a tab?, set enable/visible will load again when it makes postback. So I want to remove the tab completely.

How can I do through javascript?, I tried with below code.

C# Code: these are dynamic tabs for aspx pages.

private void AddNewTab(string TabTitle, string TargetURL)
    {
        Infragistics.WebUI.UltraWebTab.Tab tab = new Infragistics.WebUI.UltraWebTab.Tab();
        tab.AsyncOption = Infragistics.WebUI.UltraWebTab.AsyncTabOption.Excluded;
        tab.ContentPane.TargetUrl = TargetURL; //aspx page
        Session["currentTab"] = System.DateTime.Now.Ticks.ToString();
        tab.Key = Session["currentTab"].ToString();
        tab.Text = TabTitle + "&nbsp;&nbsp; <a onclick='closeTab('"+tab.Key +"')'><img src='Styles/Default/Images/closeButtonSmall.gif'/></a>";// +" <img src='redX.jpg' onclick='closeTab(&quot;tab1key&quot;)/>";
        TabPages.Tabs.Add(tab);
        TabPages.SelectedTab = TabPages.Tabs.Count - 1;
       
    } 

 

BLOCKED SCRIPT

  function closeTab(key) {
            //var tab = document.getElementById('TabPages');
            if (key != null) {
                key.style.display = "none";
            }
            return true;

And also tried below code, it doesn't work.

var myUltraWebTab = document.getElementById('igtabTabPages');

            alert(myUltraWebTab);

            myUltraWebTab.Tabs['TabPagestd0'].setEnabled(false);
            myUltraWebTab.Tabs['TabPagestd0'].setVisible(false);

 

is there any property remove tab in javascript?