From e7bad208454fdff07acf1b6f5f94b08d912453b4 Mon Sep 17 00:00:00 2001 From: Piero Nicolli Date: Wed, 13 Dec 2023 10:13:48 +0100 Subject: [PATCH] Allow reorder of data grid fields (#224) * [chg] allow reorder of data grid fields * [fix] widget props --- CHANGES.rst | 3 ++- .../plone/contenttypes/interfaces/punto_di_contatto.py | 7 ++++++- src/design/plone/contenttypes/interfaces/servizio.py | 7 ++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8de32401..936ef1a1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog 6.1.5 (unreleased) ------------------ -- Nothing changed yet. +- Allow reorder of data grid fields. + [pnicolli] 6.1.4 (2023-12-04) diff --git a/src/design/plone/contenttypes/interfaces/punto_di_contatto.py b/src/design/plone/contenttypes/interfaces/punto_di_contatto.py index 84296528..1071241f 100644 --- a/src/design/plone/contenttypes/interfaces/punto_di_contatto.py +++ b/src/design/plone/contenttypes/interfaces/punto_di_contatto.py @@ -65,7 +65,12 @@ class IPuntoDiContatto(model.Schema, IDesignPloneContentType): form.widget( "value_punto_contatto", DataGridFieldFactory, - frontendOptions={"widget": "data_grid"}, + frontendOptions={ + "widget": "data_grid", + "widgetProps": { + "allow_reorder": True, + }, + }, ) form.widget( diff --git a/src/design/plone/contenttypes/interfaces/servizio.py b/src/design/plone/contenttypes/interfaces/servizio.py index 8d18fc9a..1f53ff8a 100644 --- a/src/design/plone/contenttypes/interfaces/servizio.py +++ b/src/design/plone/contenttypes/interfaces/servizio.py @@ -464,7 +464,12 @@ class IServizio(model.Schema, IDesignPloneContentType): form.widget( "timeline_tempi_scadenze", DataGridFieldFactory, - frontendOptions={"widget": "data_grid"}, + frontendOptions={ + "widget": "data_grid", + "widgetProps": { + "allow_reorder": True, + }, + }, ) form.widget("canale_digitale_link", LinkFieldWidget)