Get Tab when created dynamically

1 posts, 0 answers
  1. Gary
    Gary avatar
    28 posts
    Member since:
    Apr 2011

    Posted 02 Dec 2012 Link to this post

    UPDATE: Much easier using JQuery

    var tabQuery = $('#workTabs  .k-tabstrip-items .k-item .k-link').filter(function () {
            return $(this).text() == tabName;

    I am creating Tabs dynamically and need to access the tab later to test if it already exists and add/change content.

    I have a function to do this but it only works in IE and not firefox. There must be a better more JQuery way of doing it.
    I have tried adding an ID field to the Tab when I create them and then using a selector but this dd not work. Any suggestions?
    function findTab(tabs, tabName) {
        var i = 0;
        var foundTab;
        while (true) {
            var next = tabs.tabGroup.children("li").eq(i);
            if (next && next.length > 0) {
                var tabText = next[0].innerText;
                if (tabText == tabName) {
                    // found
                    foundTab = next;
            if (!next || (next.length == 0)) {
        return foundTab;
Back to Top