This is a migrated thread and some comments may be shown as answers.

How to remove RadTabStrip's tab image from javascript

1 Answer 53 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Dev-OBA
Top achievements
Rank 1
Dev-OBA asked on 14 Oct 2016, 09:19 PM

Hello Telerik support

I have ImageUrl="../Images/loadingArrow.gif" set to RadTab in a RadTabstrip. After page load, ajax asynchronous request is executed and once it is successful, I want to remove the Image from the Tab. 

  <telerik:RadTab Text="Tab2" Value="Tab2" runat="server" PostBack="true" PageViewID="rpvTab2" CssClass="tab" SelectedCssClass="tabSelected" ImageUrl="Images/loadingArrow.gif"/>

I used following code in javascript which did a trick, but after the postback the original image is displayed on the Tab.

  var listChildNodes = tab.get_element().getElementsByClassName("rtsIn")["0"].childNodes;
  tab.get_element().getElementsByClassName("rtsIn")["0"].removeChild(listChildNodes[0]);

 

Can you please suggest a way to remove the Image from the Tab and also it should not be visible after postback.

 

Thanks.

Manisha

 

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 19 Oct 2016, 02:53 PM
Hello Manisha,

My guess is that your are not using the trackChanges and commitChanges client-side methods as described in the Preserving changes section of the Client-side programming overview article. You could also review the following forum post:

 Change does not persist after a postback.

Here is also a sample JavaScript code you could use to remove the icon of the RadTab and persist the changes after the postback:

tabStrip.trackChanges();
tab.set_imageUrl();
tabStrip.commitChanges();

Regards,
Peter Milchev
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
TabStrip
Asked by
Dev-OBA
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or