From a4cff9770f8c9e33c9a34dbbbe5612086619a6d6 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 4 Oct 2019 14:17:14 +0200 Subject: [PATCH] Collaborative session @manuel.montes pagination fix in datatables (hide when only 1 page) --- pandora_console/include/functions_ui.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 06c4b579ea..a0c7b18eaf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3187,14 +3187,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, @@ -3299,6 +3303,7 @@ function ui_print_datatable(array $parameters) dt_'.$table_id.'.draw().page(0) }); }); + '; // Order.