在DataTables中启用Scroll X时,底部搜索禁用

我在数据表中尝试数据显示https://datatables.net/

我可以显示从MYSQL到Datatables的数据,但我希望数据表中的列显示全部 在此处输入图像描述

这个图像,你可以看到有1列,必须点击按钮加,如果显示很多列。

我已经搜索,在数据表中启用滚动X https://datatables.net/examples/basic_init/scroll_x.html

当我把代码“scrollX”:我的代码中的true

并添加jquery https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js

这样的结果,你可以看到我在底部的输入搜索已被禁用。 和我的模板数据表不起作用。 我很困惑解决它:(

在此处输入图像描述

我想显示我的所有数据,使用scroll-x和模板数据表,搜索底部,仍然可以工作。

在线演示测试: http : //gajelos.tk/test/index.php

这是我的代码

                    



Action SIM Nama Berlaku (SIM) Jenis Plat Nomor Berlaku (Kendaraan)
Action SIM Nama Berlaku (SIM) Jenis Plat Nomor Berlaku (Kendaraan)
var dTable; // #Example adalah id pada table $(document).ready(function() { dTable = $('#example').DataTable( { "bProcessing": true, "bServerSide": true, "bJQueryUI": false, "responsive": true, "sAjaxSource": "serverSide.php", // Load Data "scrollX": true, "sServerMethod": "POST", "columnDefs": [ { "orderable": false, "targets": 0, "searchable": false }, { "orderable": true, "targets": 1, "searchable": true }, { "orderable": true, "targets": 2, "searchable": true }, { "orderable": true, "targets": 3, "searchable": true }, { "orderable": true, "targets": 4, "searchable": true }, { "orderable": true, "targets": 5, "searchable": true }, { "orderable": true, "targets": 6, "searchable": true } ] } ); $('#example').removeClass( 'display' ).addClass('table table-striped table-bordered'); //$('#example tfoot tr th').each( function () { var i = 0; $('.table').find( 'tfoot tr th' ).each( function () { //Agar kolom Action Tidak Ada Tombol Pencarian if( $(this).text() != "Action" ){ var width = $(".sorting_1").width(); var title = $('.table thead th').eq( $(this).index() ).text(); $(this).html( '' ); } i++; } ); // Untuk Pencarian, di kolom paling bawah dTable.columns().every( function () { var that = this; $( 'input', this.footer() ).on( 'keyup change', function () { that .search( this.value ) .draw(); } ); } ); } );

帮助我,谢谢