jQuery dataTable 不显示排序图标 [英] jQuery dataTable doesn't show sort icon

查看:112
本文介绍了jQuery dataTable 不显示排序图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 jQuery dataTable 插件.问题是排序图标(这个箭头指向数据实际排序的方向)没有显示.

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.

我的代码如下:

$('#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>
</table>

推荐答案

我遇到了这个问题,我发现因为我已将 CDN 脚本复制到我的本地机器,它不再像@Matt2012 指出的那样正确引用图像.所以我的解决方案是更新 CSS 文件以查找我想放置它们的图像,然后我也保存了它们.

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.

看这部分:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆