2

私はJQuery Datatablesをまったく初めて使用し、ページ化されたJQuery Datatableを含む継承したコードを持っています。ページングは​​、明示的な構成を行わなくてもデータテーブルに組み込まれているようです。

今、私の要件は、JQuery Datatable に NOT TO PAGE を指示して、テーブル データ全体を表示することです。

私は少しグーグルで調べましたが、JQuery Datatable NOT をページングするように構成できるドキュメントは見つかりませんでした。これを実装する方法を誰かが知っていれば、それは本当にありがたいです。

私の質問を調べてくれてありがとう。

4

3 に答える 3

1
于 2013-07-13T13:22:02.753 に答える
0

I have added the smartness features on the the DataTables JS lib file. to act your tables more smarter that the existing one .. I have made a functionality to remove the Search Bar, Pagination's and Show entries when the table have the records lesser than equal to 10. However it will show the # of entries at the bottom to make the end user to understand the reason behind the tables smartness.. you can add the below code to your Datatables.JS lib file to make your tables more smarter.. search for "fnDrawCallback" and add the dynamic function..

fnDrawCallback: function(e) {
    e.aoData.length > e._iFiltersDisableRowMaxLength ? 
    ($("div#" + e.sTableId + "_filter").parent().show(), 
     $("select[aria-controls='" + e.sTableId + "']").parent().show(), 
     $("div#" + e.sTableId + "_info").parent().show(), 
     $("div#" + e.sTableId + "_length").parent().show()) : 
    ($("div#" + e.sTableId + "_filter").parent().remove(), 
     $("select[aria-controls='" + e.sTableId + "']").parent().remove(), 
     $("div#" + e.sTableId + "_info").next().remove(), 
     $("div#" + e.sTableId + "_length").parent().remove())
}

add the setting variable _iFiltersDisableRowMaxLength: 10 under DataTable.models.oSettings

this code will help you to add the smartness through out the site where ever you use the data-tables.

于 2016-01-27T15:03:54.323 に答える