Disable Pagination,Search bar and "show entries" when table display records lesser than 10

Disable Pagination,Search bar and "show entries" when table display records lesser than 10

nrkamleshnrkamlesh Posts: 1Questions: 0Answers: 0
edited January 2016 in Free community support

Hi Team, 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.

Thanks,
Kamlesh Nattamai

This discussion has been closed.