feat(tableau): sélecteur de colonnes piloté par columnDefs (#41)
apply_hidden_columns régénère columnDefs (via grid_column_defs) sur tableau_grid quand le Store tableau-hidden-columns change, remplaçant store_hidden_columns qui ciblait l'ancienne prop hidden_columns de la DataTable (supprimée en tâche 7). update_checkboxes_from_hidden_columns lit désormais directement le Store plutôt que la prop de la DataTable disparue, pour que la synchronisation cases à cocher <-> colonnes masquées continue de fonctionner. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -636,21 +636,18 @@ def update_hidden_columns_from_checkboxes(selected_columns):
|
|||||||
|
|
||||||
|
|
||||||
@callback(
|
@callback(
|
||||||
Output("tableau_datatable", "hidden_columns"),
|
Output("tableau_grid", "columnDefs"),
|
||||||
Input(
|
Input("tableau-hidden-columns", "data"),
|
||||||
"tableau-hidden-columns",
|
|
||||||
"data",
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
def store_hidden_columns(hidden_columns):
|
def apply_hidden_columns(hidden_columns):
|
||||||
if hidden_columns is None:
|
if hidden_columns is None:
|
||||||
hidden_columns = get_default_hidden_columns("tableau")
|
hidden_columns = get_default_hidden_columns("tableau")
|
||||||
return hidden_columns
|
return grid_column_defs(hidden_columns)
|
||||||
|
|
||||||
|
|
||||||
@callback(
|
@callback(
|
||||||
Output("tableau_column_list", "selected_rows"),
|
Output("tableau_column_list", "selected_rows"),
|
||||||
Input("tableau_datatable", "hidden_columns"),
|
Input("tableau-hidden-columns", "data"),
|
||||||
State("tableau_column_list", "selected_rows"), # pour éviter la boucle infinie
|
State("tableau_column_list", "selected_rows"), # pour éviter la boucle infinie
|
||||||
)
|
)
|
||||||
def update_checkboxes_from_hidden_columns(hidden_cols, current_checkboxes):
|
def update_checkboxes_from_hidden_columns(hidden_cols, current_checkboxes):
|
||||||
|
|||||||
Reference in New Issue
Block a user