修改排序箭头不改变bug

This commit is contained in:
DuanDongmei
2018-11-15 11:39:26 +08:00
parent 3db292aa2e
commit 642c0276ea

View File

@@ -10,11 +10,9 @@
$(document).ready(function() {
var orderBy = $("#${id}").val().split(" ");
$(".sort-column").each(function(){
if ($(this).hasClass(orderBy[0])){
/* orderBy[1] = orderBy[1]&&orderBy[1].toUpperCase()=="DESC"?"down":"up";
$(this).html($(this).html()+" <i class=\"sort-icon-"+orderBy[1]+"\"></i>"); */
$(this).html($(this).html()+" <i class=\"sort-icon\"></i>");
if (orderBy[0] !=null && orderBy[0] !='' && $(this).hasClass(orderBy[0])){
orderBy[1] = orderBy[1]&&orderBy[1].toUpperCase()=="DESC"?"down":"up";
$(this).html($(this).html()+" <i class=\"sort-icon-"+orderBy[1]+"\"></i>");
}else {
$(this).html($(this).html()+" <i class=\"sort-icon\"></i>");
}