diff --git a/css/backoffice/components/_datatable.scss b/css/backoffice/components/_datatable.scss index 78ec80a7d..89b0aeaee 100644 --- a/css/backoffice/components/_datatable.scss +++ b/css/backoffice/components/_datatable.scss @@ -122,6 +122,7 @@ $ibo-fieldsorter--selected--background-color: $ibo-color-blue-200 !default; } } -.ibo-datatable--selected-count{ +.ibo-datatable--selected-count, .ibo-datatable--result-count{ padding-right: 0.2em; + padding-left: 0.1em; } \ No newline at end of file diff --git a/templates/base/components/datatable/layout.ready.js.twig b/templates/base/components/datatable/layout.ready.js.twig index 4914a402f..3b753c6c8 100644 --- a/templates/base/components/datatable/layout.ready.js.twig +++ b/templates/base/components/datatable/layout.ready.js.twig @@ -83,7 +83,10 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({ } }, drawCallback: function (settings) { - $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + if(settings.json) + { + $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + } if ($(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative") { $(this).closest('.dataTables_wrapper').find('.checkAll')[0].checked = true; @@ -108,7 +111,10 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({ }, {% else %} drawCallback: function (settings) { - $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + if(settings.json) + { + $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + } $(this).closest('.dataTables_wrapper').unblock(); // Hiding pagination if only one page if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2) diff --git a/templates/base/components/datatable/static/formtable/layout.ready.js.twig b/templates/base/components/datatable/static/formtable/layout.ready.js.twig index cbc79dae6..0560a9ba7 100644 --- a/templates/base/components/datatable/static/formtable/layout.ready.js.twig +++ b/templates/base/components/datatable/static/formtable/layout.ready.js.twig @@ -24,7 +24,10 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({ ], {% endif %} drawCallback: function (settings) { - $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + if(settings.json) + { + $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + } // Hiding pagination if only one page if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2) { diff --git a/templates/base/components/datatable/static/layout.ready.js.twig b/templates/base/components/datatable/static/layout.ready.js.twig index a252c7d19..30f94e0ee 100644 --- a/templates/base/components/datatable/static/layout.ready.js.twig +++ b/templates/base/components/datatable/static/layout.ready.js.twig @@ -56,7 +56,10 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({ {% endfor %} ], drawCallback: function (settings) { - $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + if(settings.json) + { + $(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal); + } // Hiding pagination if only one page if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2) {