如何在追加后按字母顺序排序kendotabStrip

时间:2015-06-20 07:53:29

标签: kendo-ui jquery-ui-sortable kendo-tabstrip kendo-ui-grid

这是我的代码

var tabStrip = $("#createPackageRoomType ul").kendoTabStrip().data("kendoTabStrip");

tabStrip.append({ text: $(this).attr('label'), content: $('#createPackageRoomTaskList').val() });
tabStrip.select((tabStrip.tabGroup.children("li").length - 1));
tabStrip.tabGroup.children("li.k-state-active").attr("id",$(this).attr('label')+"_"+$(this).attr('value'));
tabStrip.tabGroup.children("li.k-state-active").attr("value",$(this).attr('value'));
tabStrip.tabGroup.children("li.k-state-active").attr("label",$(this).attr('label'));"checkedCheckbox(\"'$(this).attr('value')'\")"
tabStrip.tabGroup.children("li.k-state-active").attr("onclick",'checkedCheckbox(\"'+$(this).attr('value')+'\");');

1 个答案:

答案 0 :(得分:0)

使用此功能:

function sortTabs(tabStripId){
    var tabstrip = $("#" + tabStripId).data("kendoTabStrip");
    tabstrip.tabGroup.children().sort(function(a, b){
          return $(a).find('.k-link').text() > $(b).find('.k-link').text() ? 1 : -1;
    }).each(function(ind, val){
        tabstrip.tabGroup.append(val);
    });
}

Kendo dojo示例:http://dojo.telerik.com/udaNe

相关问题