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

查看:167
本文介绍了如何从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,这只是一种不同的方式来实现这一点。 p>

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天全站免登陆