简体   繁体   中英

Kendo TabStrip set Id for created tab

I have Kendo TabStrip and I add new tab like this

tabStrip.append({
                        text: name + "  <button data-type='remove' class='k-button k-button-icon' onClick='closeTab($(this).closest(\"li\"));'><span class='k-icon k-i-close'></span></button>",
                        encoded: false,
                        contentUrl: "/Info/Index?id=" + id
                    });

How can I set ID for this tab?

After your append, set the id attribute:

tabStrip.tabGroup.children().last().attr("id", "myId" + tabsLength); 

Example: http://dojo.telerik.com/OJOPo/5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM