微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jQuery dataTable不显示排序图标

我试图使用一个jQuery dataTable插件.问题是不显示排序图标(指向哪个方向数据实际排序的箭头).

我的代码如下所示:

$('#example').dataTable(
{
    "bPaginate": false,"bFilter": false,"oLanguage": { "sInfo": ""}        
}
);

和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>

解决方法

我有这个问题,我发现因为我已经将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; }

原文地址:https://www.jb51.cc/jquery/180376.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐