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!

 

Parents
No Data
Reply
  • 17590
    Offline posted

    Hello Shane,

    Thank you for posting in the community.

    Please note that the only supported operation on the client is to append(not insert) new tab item. In this situation a special flag is passed from client to server and view states of all existing/old tabs is preserved. The delete tab item on the client is not supported because it will not be possible to maintain viewstate of old tab items. Some further reference may be found at:

    http://es.infragistics.com/community/forums/t/71211.aspx?PageIndex=1

    Currently I am investigating your issue and will ask our engineering staff to examine this further. The next step will be a developer to review my investigation and confirm my findings or to offer a fix, or other resolution. I will provide you with the number of the internal task for you to be able to view the status of development issue connected to this case. You can also continue to send updates to this case at any time.

    As an alternative approach, I can suggest putting the WebTab in an update panel and make an asynchronous call to the server vie the javascript _doPostBack method as such:

    function addTab(){

           var webTab = $find("<%= WebTab1.ClientID %>");

            webTab.addTab("New Tab");

            __doPostBack('<%=UpdPan.ClientID %>',null);

        }

    I am attaching the sample project used to test this. My test was performed using version 12.2.20122.2075 .

    Hope this helps. Please feel free to contact me if you have any additional questions regarding this matter.

    WebTabCloseButton.zip
Children