Hello,
Thanks so much for grocery CRUD, I'm enjoying getting started with it.
I'm trying to change the paging options to include more than 100 rows... if I add additional options to $data->paging_options in libraries/grocery_crud.php they show up in the flexigrid theme but not in the datatables theme.
What do I need to change to get datatables to show more paging options?
Changing paging options - datatables theme
Started by possibleworlds, 27 May 2012 - 10:57 AM
- Single Page
Posted 27 May 2012 - 10:57 AM
Posted 27 May 2012 - 11:25 AM
A work around for this is:
You can go to: assets/grocery_crud/themes/datatables/js/datatables.js and add something similar to this:
so for example your code will be:
For more about aLengthMenu you can go strait away to : http://datatables.ne...ength_menu.html
The $data->paging_options is only available for flexigrid theme now but I will add an issue to have it to datatables also.
You can go to: assets/grocery_crud/themes/datatables/js/datatables.js and add something similar to this:
"aLengthMenu": [[10, 25, 50, 100, 200, -1], [10, 25, 50, 100, 200, "All"]]
so for example your code will be:
var default_per_page = typeof default_per_page !== 'undefined' ? default_per_page : 25;
$(document).ready(function() {
oTable = $('#groceryCrudTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bStateSave": true,
"aLengthMenu": [[10, 25, 50, 100, 200, -1], [10, 25, 50, 100, 200, "All"]],
"iDisplayLength": default_per_page,
.....
For more about aLengthMenu you can go strait away to : http://datatables.ne...ength_menu.html
The $data->paging_options is only available for flexigrid theme now but I will add an issue to have it to datatables also.