From bd47ca34df67c595872aa846bcc520a6cc47ed37 Mon Sep 17 00:00:00 2001 From: acognet Date: Tue, 2 Mar 2021 17:22:11 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03634=20-=20Add=20count=20for=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Base/Component/DataTable/DataTableUIBlockFactory.php | 2 ++ templates/base/components/datatable/layout.ready.js.twig | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php b/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php index cdbffe748..4a4c8b6cd 100644 --- a/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php +++ b/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php @@ -129,7 +129,9 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory } if (!isset($aExtraParams['surround_with_panel']) || $aExtraParams['surround_with_panel']) { + $iCount = $oSet->Count(); $oContainer = PanelUIBlockFactory::MakeForClass($oSet->GetClass(), "")->AddCSSClass('ibo-datatable-panel'); + $oContainer->SetSubTitle(Dict::Format("UI:Pagination:HeaderNoSelection", $iCount)); $oContainer->AddToolbarBlock($oBlockMenu); $oContainer->AddMainBlock($oDataTable); } else { diff --git a/templates/base/components/datatable/layout.ready.js.twig b/templates/base/components/datatable/layout.ready.js.twig index 989f5d753..f58ebc3ff 100644 --- a/templates/base/components/datatable/layout.ready.js.twig +++ b/templates/base/components/datatable/layout.ready.js.twig @@ -174,7 +174,7 @@ var oTable{{ sListId }} = $('#{{ oUIBlock.GetId() }}').DataTable({ url: "{{ oUIBlock.GetAjaxUrl() }}", data: {{ oUIBlock.GetJsonAjaxData() |raw }}, method: "post", - pages: 5 // number of pages to cache + pages: 1 // number of pages to cache }), initComplete: function () { this.api().columns.adjust().draw();