Programmatically change the text of the display label

Hi,

I need to be able to programmatically change the display label after the tab has been created. How can I achieve that?

I tried the following:

tab.items[0].textContent = "haha";

and 

tab.items[0].innerText = "haha";

It didn't work properly (see attachment in zip file) 

The text changed, but the formatting is completely gone, and after changing the text, not of the other tabs are clickable. 

Attachment: 1_44548714.zip

1 Reply

PO Prince Oliver Syncfusion Team November 29, 2017 09:16 AM UTC

Hi Louis, 

Thank you for using Syncfusion products. 

You have changed the entire contents of the <li> element instead of the changing the text contents of the <a> element inside the <li> element. Hence the issue occurs in your end. Replacing your code with the following code will fix the issue. 

var tab = $("#tabSample").data("ejTab") 
tab.items[0].children[0].innerText = "haha" 

We have prepared a sample for your reference, please refer to the following link for the sample: http://www.syncfusion.com/downloads/support/forum/134786/7z/TabHeaderText-1362153793 

Regards, 
Prince 


Loader.
Up arrow icon