HTML in tab text

2 posts, 0 answers
  1. Shawn
    Shawn avatar
    13 posts
    Member since:
    Mar 2015

    Posted 09 Jun 2015 Link to this post

    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>

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 11 Jun 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top