数据表在标题上显示双顺序图标 [英] datatables show double order icon on header
问题描述
我正在使用带有引导程序的数据表创建一个简单的表
I'm creating a simple table using datatables with bootstrap with this instructions
var bTable = $('#example2').DataTable( {
language: { url: 'assets/plugins/datatables/i18n/Spanish.json' },
processing: true,
fixedHeader: true,
serverSide: true,
responsive:true,
ajax: "modulos/estados.data.php",
columns: [
{ data: "id561" },
{ data: "des561" },
{ data: "accion561" },
{ data: "res561" }
],
order: [[ 1, "asc" ]],
columnDefs: [
{
targets : 0,
searchable: false,
render: function ( data, type, row )
{ return row.id561 }
},
{
targets : 1,
searchable: true,
render: function ( data, type, row )
{ return data }
},
{
targets : 2,
searchable: false,
render: function ( data, type, row )
{ return data }
},
{
targets : 3,
orderable: false,
searchable: false,
render: function ( data, type, row )
{ return data }
}
]
} );
问题是它在标题上显示订单图标两次,如图所示
The problem is that its show on header the order icon twice as shown on image
问题仅在于激活 Bootstrap css,如果我使用 jquery 它的作品
the problem is only activating Bootstrap css, if I use jquery its works
感谢您的帮助!
推荐答案
确保你不包括 DataTables CSS 文件 (jquery.dataTables.min.css
),只包括 dataTables.bootstrap.min.css
.
Make sure that you're not including DataTables CSS file (jquery.dataTables.min.css
), only dataTables.bootstrap.min.css
.
如果您使用 下载生成器,请在 Bootstrap强>造型部分.如果您已经包含 Bootstrap,请选择无样式库,否则选择包含库以包含最新的 Bootstrap.
If you're using Download Builder, select Bootstrap in the Styling section. If you already have Bootstrap included, chose No styling library, otherwise chose Include library to include the latest Bootstrap as well.
有关正确用法的演示,请参阅此示例.
See this example for demonstration of correct usage.
这篇关于数据表在标题上显示双顺序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!