Looking at the documentation, there is no clear way that I see to delete/remove a tab. There are addTab, addCopy, moveTab, etc... but no deleteTab or removeTab or even closeTab.
I need to completely delete a tab. Has anyone seen a way to do this client-side?
Hi, Revbones.
It's seems that the WebTab API don't have such client-side functionality. I suppose there is a reason for this so I will investigate it and will inform you.
Meanwhile I can suggest you workaround for this. You can hide the tabs on the client, those you want to delete, and on the server to check all the hidden tabs and delete them from the tabs collection.
var webTab = $find("<%=WebTab1.ClientID%>"),
tab = webTab.getTabAt(0);
tab.set_hidden(true);
I hope this will help you.
Thanks,Nikolay
Unfortunately hiding tabs won't work for me. I'm loading data via client side templates and feel fairly certain that after a while of creating and hiding tabs that I'll start to run into trouble.
HI V,
I added this FixID method in the sample application I had send to you and it was giving still same JScript error. I happens if you open three tab and close the center one i.e., Tab0 Tab1 and Tab2. If you try to close Tab1 you can see that JScript.
Thanks for immediate response
Dk
Hi Dk,
I could not reproduce JScript error on the first attempt to remove 2nd tab, but only after repeating add/remove actions few times. Last time I tested your codes with asp:ScriptManager. Today I added reference to AjaxControlToolkit and replaced ScriptManager with asp:ToolkitScriptManger.
Both cases worked exactly same way and exception was raised in MicrosoftAjaxWebForms.debug.js.
Under ScriptManager it was at the end of
function Sys$WebForms$PageRequestManager$_endPostBack(error, executor, data) {...}
and in case of ToolkitScriptManager it was at the end of a similar function
_endPostBack: function PageRequestManager$_endPostBack(error, executor, data) {...}
I tested sample within a website of VisualStudio2008. AjaxControlToolkit.dll: 11/16/2011, File Version: 3.5.51116.0.
Maybe there is something else is different in our samples, or there are different versions of AjaxControlToolkit.
I upgraded my AjaxControlToolkit dll but still getting same issue. I am sending you my sample code with your changes again. And I am also running this in VisualStudio2008
Thanks,
I retested sample with same results.
I noticed that your sample uses old Infragistics35.Web.v10.2.dll. I think that is the reason why I could not reproduce that. The earliest dll on my machine is Infragistics35.Web.v11.1.
I looked at history in tfs to complare some source files and found some differences, which may affect that scenario. For example, the newer versions of WebTab force instantiation of templates at run time within OnInit event. Older version waited for CreateChildControls or OnPreRender/Render.
I suggest you to upgrade NetAdvantage to more recent version.
Hi Viktor,
I upgraded my infragistics dll to Infragistics35.Web.v11.2.dll for same sample application and still had same "Microsoft JScript runtime error: Unable to get value of the property '0': object is null or undefined" error poping up. It does not display error on firefox but it hangs when you try to remove middle tab.
Browsers tested on: IE9, IE8 and Firefox
IDE used: Visual Studio 2008 & 2010 ( Same result on both)
OS used : Windows 7
Target Framework: .net 3.5
AjaxControlToolkit used: 3.5.60623.0
If you are not able to reproduce this issue. I can send you precompiled published folder to test but for that I may need your personal email address because this site has size restrictions for attachments.
Ok I got it working with the latest Service Release of Infragistics35.Web.v11.2 version Version=11.2.20112.2159,
and also Infragistics35.Web.v12.1 with latest service release Version=12.1.20121.2048.
Hi VK,
I was on vacation and could not reply you earlier. Actually I tried my sample application with Infragistics35.Web.v12.1, Version=12.1.20121.1005 and I am getting exactly same behaviour.
Appreciate your help!
I built debug dll for version 11.2.20112.1019 and reproduced exception, which you referred to.
Please, get latest service release for NetAdvantage.
We have license for Infragistic dll 11.2 dll and its version is 11.2.20112.1019.
About AjaxControlToolkit , I was using old version earlier and was facing similar issue. Upgrading to latest version did not help at all.
Thanks for prompt responses,
I cannot give my personal email, maybe there are some other options to down load large attachement. I can consult developer support about that.
I assume that you have latest version of 11.2 dll, which is 11.2.20112.2159 or 11.2.20112.2141. Those versions should be ok. If you have earlier version, then please give me its exact version. (You may look at File version within Details of dll Properties).I could try to find its date in tfs history, gets all files for that date and build debug dll from them. Though, I would like to avoid similar.That is possible that there are other changes in codes of WebTab (besides InstantiateTemplates within OnInit), which make difference for your application.
The best choice is to use the most recent available service release.
To exclude possible issue with version of AjaxControlToolkit, you may replace it in your sample by ScriptManager and check if it makes any difference.