Skip to content

Commit

Permalink
Start using the new layout option of datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Oct 30, 2024
1 parent a5fd3c2 commit 14633b7
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions templates/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,19 @@
{/literal}
{literal}
var itemlist = $('table.dataTable').DataTable({
"stateSave": true,
"searching": true,
"paging": true,
"info": true,
"processing": true,
layout: {
topStart: {
{/literal}
{if $datatables_page_length_choices}
"lengthMenu": [
[ {$datatables_page_length_choices} ],
[ {$datatables_page_length_choices|replace:'-1':($msg_pager_all|string_format:'"%s"') nofilter} ]
],
{/if}
{if $datatables_page_length_default}
"pageLength": {$datatables_page_length_default},
pageLength: {
menu: [ {$datatables_page_length_choices} ]
}
{/if}
{literal}
"dom":
"<'row ft-head'<'col-sm-3'{/literal}{if $datatables_page_length_choices}l{/if}{literal}><'col-sm-3'f><'col-sm-6'p>>" +
"<'row dt-main'<'col-sm-12'tr>>" +
"<'row dt-foot'<'col-sm-6'i><'col-sm-6'p>>" +
"<'row dt-foot'<'col-sm-12'B>>",
/* "buttons": [
{ extend: 'print', autoPrint: {/literal}{if $datatables_auto_print}true{else}false{/if}{literal}, text: "{/literal}<i class=\"fa fa-print\"></i> {$msg_print_all}{literal}", className: "btn-info" },
{ extend: 'print', autoPrint: {/literal}{if $datatables_auto_print}true{else}false{/if}{literal}, exportOptions: {modifier:{page: 'current'}}, text: "{/literal}<i class=\"fa fa-print\"></i> {$msg_print_page}{literal}", className: "btn-info" },
],*/
"order": [
[ {/literal}{if is_int($listing_sortby)}{$listing_sortby}{else}1{/if}{literal}, "asc" ]
],
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ['nosort'] },
],
"language": {
"url": "vendor/datatables/i18n/{/literal}{$lang|default:'en'}{literal}.json"
},
},
language: {
url: "vendor/datatables/i18n/{/literal}{$lang|default:'en'}{literal}.json"
}
});
{/literal}
Expand Down

0 comments on commit 14633b7

Please sign in to comment.