From 6b133c21ab701356685a7fd91ce7aa67ad8cf632 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Sat, 15 Nov 2025 21:08:28 +0100 Subject: [PATCH] =?UTF-8?q?Classe=20partag=C3=A9e=20pour=20la=20g=C3=A9n?= =?UTF-8?q?=C3=A9ration=20de=20datatables=20#56?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/recherche.py | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/pages/recherche.py b/src/pages/recherche.py index 4ce7877..aceebb2 100644 --- a/src/pages/recherche.py +++ b/src/pages/recherche.py @@ -1,5 +1,6 @@ -from dash import Input, Output, callback, dash_table, dcc, html, register_page +from dash import Input, Output, callback, dcc, html, register_page +from src.figures import DataTable from src.utils import ( df_acheteurs, df_titulaires, @@ -73,31 +74,13 @@ def update_search_results(query): className=f"results_{org_type}", children=[ html.H3(f"{org_type.title()}s : {count}"), - dash_table.DataTable( + DataTable( + dtid=f"results_{org_type}_datatable", columns=columns, data=results.to_dicts(), page_size=10, - # style_table={"overflowX": "auto"}, - markdown_options={"html": True}, - cell_selectable=False, - style_cell_conditional=[ - { - "if": {"column_id": "acheteur_nom"}, - "maxWidth": "250px", - "textAlign": "left", - "overflow": "hidden", - "lineHeight": "18px", - "whiteSpace": "normal", - }, - { - "if": {"column_id": "titulaire_nom"}, - "maxWidth": "250px", - "textAlign": "left", - "overflow": "hidden", - "lineHeight": "18px", - "whiteSpace": "normal", - }, - ], + sort_action="none", + filter_action="none", ), ], )