如何从 DataTables 中删除排序选项? [英] How to remove sorting option from DataTables?

查看:41
本文介绍了如何从 DataTables 中删除排序选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 DataTables 插件.我不想使用每个 <thead> 默认提供的排序选项(按 ASC 或 DESC 顺序对列进行排序).如何删除该排序图标?

I'm using DataTables plugin. I don't want to use the sorting option (to sort the columns in ASC or DESC order) which comes by default on each <thead>. How can I remove that sorting icon?

推荐答案

与@ravisolanki07 非常相似,只是实现方式不同.

Very similar to @ravisolanki07 , it's just a different way to achieve this.

var oTable = $('#example').dataTable( {
    "aoColumnDefs": [
        { "bSortable": false, "aTargets": [ 0, 1, 2, 3 ] }, 
        { "bSearchable": false, "aTargets": [ 0, 1, 2, 3 ] }
    ]
}); 

这篇关于如何从 DataTables 中删除排序选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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