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
945
Adding a Tab via JavaScript with a close button?
posted

Hello,

I have a WebTab (12.2) on a page that has 5 tabs I want to keep fixed. By clicking on a button in the content area of any of those tabs, i am calling the following javascript function:

function addTab() {
var webTab = $find("<%= wt_default.ClientID%>");
webTab.addTab("Case Details", 'Case.aspx', true);
webTab.set_height(700);
}

That part is working fine but, i also want the new tab to have a close button wile the other 5 existing tabs to not have one. I tried setting each tab with EnableCloseButton ="False" wile having  <CloseButton Enabled="true" /> above the <tab> tags and It looked like it almost worked as it added a space for the close button but didn't actually create the button. Only way i've gotten it to appear is if the first tab is already set with the EnabledCloseBUtton = True and the rest of the tabs are equal to false will the above code work... but i need the first tab's close button set to false as well.

Is there a way to make the close button enabled via javascript function i made above?

 

Thanks!