jQuery dataTable不显示排序图标 [英] jQuery dataTable doesn't show sort icon
本文介绍了jQuery dataTable不显示排序图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码如下所示:
$('#example')。dataTable(
{
bPaginate:false,
bFilter :false,
oLanguage:{sInfo:}
}
);
和Html:
< table class =surfClasscellspacing =1id =example>
< thead>
< tr>
< th width =120px> Name< / th>
< th width =120px>小时费率(点数)< / th>
< th>推荐级别< / th>
< th>奖金< / th>
< th width =70px>支付最低< / th>
< / tr>
< / thead>
解决方案
我遇到这个问题,我的本地机器的CDN脚本,它没有正确地引用图像@ Matt2012指出。所以我的解决方案是更新CSS文件,以便在我保存它们之后找到我想要放置的图像。
请参阅这部分:
table.dataTable thead .sorting {background:url('/ Content / images / sort_both.png')no-repeat center right; }
table.dataTable thead .sorting_asc {background:url('/ Content / images / sort_asc.png')no-repeat center right; }
table.dataTable thead .sorting_desc {background:url('/ Content / images / sort_desc.png')no-repeat center right; }
table.dataTable thead .sorting_asc_disabled {background:url('/ Content / images / sort_asc_disabled.png')no-repeat center right; }
table.dataTable thead .sorting_desc_disabled {background:url('/ Content / images / sort_desc_disabled.png')no-repeat center right; }
I am trying to use a jQuery dataTable plugin. The problem is that the sort icon (this arrow which point in which direction data is actual sorted) is not displayed.
My code looks as follows:
$('#example').dataTable(
{
"bPaginate": false,
"bFilter": false,
"oLanguage": { "sInfo": ""}
}
);
and Html:
<table class="surfClass" cellspacing="1" id="example">
<thead>
<tr>
<th width="120px">Name</th>
<th width="120px">The hourly rate (points)</th>
<th>Levels of referrals</th>
<th>bonuses</th>
<th width="70px">Payout minimum</th>
</tr>
</thead>
解决方案
I had this problem, I found because I had copied the CDN script to my local machine it wasn't referencing the images correctly anymore as @Matt2012 pointed out. So my solution was to updated the CSS file to look for those images where I want to put them, after I saved them also.
See this part:
table.dataTable thead .sorting { background: url('/Content/images/sort_both.png') no-repeat center right; }
table.dataTable thead .sorting_asc { background: url('/Content/images/sort_asc.png') no-repeat center right; }
table.dataTable thead .sorting_desc { background: url('/Content/images/sort_desc.png') no-repeat center right; }
table.dataTable thead .sorting_asc_disabled { background: url('/Content/images/sort_asc_disabled.png') no-repeat center right; }
table.dataTable thead .sorting_desc_disabled { background: url('/Content/images/sort_desc_disabled.png') no-repeat center right; }
这篇关于jQuery dataTable不显示排序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文