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 + " <a onclick='closeTab('"+tab.Key +"')'><img src='Styles/Default/Images/closeButtonSmall.gif'/></a>";// +" <img src='redX.jpg' onclick='closeTab("tab1key")/>"; 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?
Removing adding tabs on client is not supported. The best you can do on client is to fake add/remove by show/hide existing tabs.