From c83a31a3c2ad0a80936a9a6184270cb222c5896a Mon Sep 17 00:00:00 2001 From: Thorsten Hack Date: Tue, 6 Feb 2024 15:44:22 +0100 Subject: [PATCH] Make paging in Data Manager configurable --- CHANGELOG.md | 2 +- .../DataManagerBundle/Resources/public/TableRenderer.js | 7 ++++--- src/Mapbender/DigitizerBundle/Component/SchemaFilter.php | 9 --------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a4694a..404faa92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ * Repair Radiobutton ([PR#98](https://github.com/mapbender/mapbender-digitizer/pull/98)) * Add default whitepace: pre-line in text fields to keep formatting ([PR#98](https://github.com/mapbender/mapbender-digitizer/pull/98)) * Allow to set text area height by providing row attribute ([PR#98](https://github.com/mapbender/mapbender-digitizer/pull/98)) - +* Add option `paging` on root level to disable paging ([PR#99](https://github.com/mapbender/mapbender-digitizer/pull/99)) ## 1.5.7 * Rewrite context menu for Openlayers 7 compatibility diff --git a/src/Mapbender/DataManagerBundle/Resources/public/TableRenderer.js b/src/Mapbender/DataManagerBundle/Resources/public/TableRenderer.js index 52c70d52..c4f2f5f9 100644 --- a/src/Mapbender/DataManagerBundle/Resources/public/TableRenderer.js +++ b/src/Mapbender/DataManagerBundle/Resources/public/TableRenderer.js @@ -125,15 +125,16 @@ if (buttonColumnOptions) { columnsOption.push(buttonColumnOptions); } + var settings = { columns: columnsOption, lengthChange: false, - pageLength: (schema.table || {}).pageLength || 16, - searching: (schema.table || {}).searching || (typeof ((schema.table || {}).searching) === 'undefined'), + pageLength: schema.pageLength || 16, + searching: schema.inlineSearch ?? true, info: true, processing: false, ordering: true, - paging: true, + paging: schema.paging ?? true, selectable: false, oLanguage: this.getOLanguageOption(schema), autoWidth: false diff --git a/src/Mapbender/DigitizerBundle/Component/SchemaFilter.php b/src/Mapbender/DigitizerBundle/Component/SchemaFilter.php index bfd29a99..27808181 100644 --- a/src/Mapbender/DigitizerBundle/Component/SchemaFilter.php +++ b/src/Mapbender/DigitizerBundle/Component/SchemaFilter.php @@ -91,16 +91,7 @@ public function processSchemaBaseConfig(array $schemaConfig, $schemaName) if (!empty($schemaConfig['tableFields'])) { $schemaConfig['table'] += array('columns' => $schemaConfig['tableFields']); } - if (isset($schemaConfig['inlineSearch'])) { - $schemaConfig['table']['searching'] = $schemaConfig['inlineSearch']; - } - if (!empty($schemaConfig['pageLength'])) { - $schemaConfig['table']['pageLength'] = $schemaConfig['pageLength']; - } - unset($schemaConfig['tableFields']); - unset($schemaConfig['inlineSearch']); - unset($schemaConfig['pageLength']); // resolve aliasing DM "allowEdit" vs historical Digitizer "allowEditData" if (\array_key_exists('allowEditData', $schemaConfig)) {