Merge branch 'ent-4763-paginacion-datatables' into 'develop'

datatables hide when only 1 page

See merge request 
This commit is contained in:
Daniel Rodriguez 2019-10-11 12:46:22 +02:00
commit adaead5f8f
1 changed files with 9 additions and 4 deletions
pandora_console/include

View File

@ -3191,14 +3191,18 @@ function ui_print_datatable(array $parameters)
$.fn.dataTable.ext.errMode = "none";
$.fn.dataTable.ext.classes.sPageButton = "'.$pagination_class.'";
dt_'.$table_id.' = $("#'.$table_id.'").DataTable({
';
drawCallback: function(settings) {';
if (isset($parameters['drawCallback'])) {
$js .= 'drawCallback: function(settings) {
'.$parameters['drawCallback'].'
},';
$js .= $parameters['drawCallback'];
}
$js .= '
if (dt_'.$table_id.'.page.info().pages > 1) {
$("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").show()
} else {
$("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").hide()
}
},
processing: true,
serverSide: true,
paging: true,
@ -3303,6 +3307,7 @@ function ui_print_datatable(array $parameters)
dt_'.$table_id.'.draw().page(0)
});
});
</script>';
// Order.