From 55dca61a96467e9a325530d4837faa8e4482c72f Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Mon, 21 Apr 2025 01:19:04 +0200 Subject: [PATCH] =?UTF-8?q?Pas=20de=20s=C3=A9lection=20colonne/cellue,=20f?= =?UTF-8?q?ixed=20pagination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 3def853..7f81984 100644 --- a/app.py +++ b/app.py @@ -10,6 +10,7 @@ app = Dash(external_stylesheets=[dbc.themes.UNITED], title="decp.info") server = app.server datatable = dash_table.DataTable( + cell_selectable=False, id="table", data=df.to_dicts(), page_size=20, @@ -17,7 +18,7 @@ datatable = dash_table.DataTable( page_action="native", # filter_action="native", columns=[ - {"name": i, "id": i, "deletable": True, "selectable": True} for i in df.columns + {"name": i, "id": i, "deletable": True, "selectable": False} for i in df.columns ], selected_columns=[], selected_rows=[], @@ -53,11 +54,11 @@ def global_search(text): return new_df.to_dicts() -@callback( - Output("table", "data"), Input("table", "page_current"), Input("table", "page_size") -) -def update_table(page_current, page_size): - return df[page_current * page_size : (page_current + 1) * page_size].to_dicts() +# @callback( +# Output("table", "data"), Input("table", "page_current"), Input("table", "page_size") +# ) +# def update_table(page_current, page_size): +# return df[page_current * page_size : (page_current + 1) * page_size].to_dicts() if __name__ == "__main__":