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

HTML in tab text

1 Answer 253 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 09 Jun 2015, 11:02 PM

I'm unable to add html to the tab text. It outputs the html code.

            var tabHeader = value["AddressTypeDescription"];
            var tab = $('<div>').attr('name', tabHeader);
            $(tabpanel.contentHolder(0)).children().clone().appendTo(tab);
                        
            var vm = kendo.observable(value);
            kendo.bind(tab, vm);

            //Need to do this otherwise the input values will not get passed
            tab.children().find('input').each(function () { $(this).attr('value', this.value);})
            
            //renders html code
            var closeButton = "<span unselectable='on' class='k-icon k-delete'>delete</span>";
            tabpanel.insertAfter({
                text: tabHeader+' '+ closeButton,
                content: tab.html()
            }
                , tabpanel.tabGroup.children(":nth-last-child(2)")
            );

 

This is the output:

Company <span unselectable='on' class='k-icon k-delete'>delete</span>

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 11 Jun 2015, 11:16 AM
Hello,

you need to enable the encoded configuration option, like our documentation suggests.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TabStrip
Asked by
Shawn
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or