SharePoint 2013 sort Left navigation using jquery
var $eleContainer = $("tr td:last-child.ms-tv-item").closest('div');
var $aryTblChl = $eleContainer.children('table');
$aryTblChl.sort(function (a, b) {
a = $(a).find("tr td:last-child.ms-tv-item").text();
b = $(b).find("tr td:last-child.ms-tv-item").text();
return (a == b) ? 0 : ((a > b) ? 1 : -1);
}); $aryTblChl.detach().appendTo($eleContainer);
var $eleContainer = $("tr td:last-child.ms-tv-item").closest('div');
var $aryTblChl = $eleContainer.children('table');
$aryTblChl.sort(function (a, b) {
a = $(a).find("tr td:last-child.ms-tv-item").text();
b = $(b).find("tr td:last-child.ms-tv-item").text();
return (a == b) ? 0 : ((a > b) ? 1 : -1);
}); $aryTblChl.detach().appendTo($eleContainer);
No comments:
Post a Comment