Feat: not showing all columns in bigtable and fixe first columns

This commit is contained in:
Bertrand Benjamin 2021-01-27 16:16:54 +01:00
parent 429fed6a1e
commit 589d63ff29

View File

@ -127,12 +127,22 @@ layout = html.Div(
dash_table.DataTable( dash_table.DataTable(
id="scores_table", id="scores_table",
columns=[ columns=[
{"id": c, "name": c} for c in NO_ST_COLUMNS.values() {"id": "id", "name": "Question"},
{
"id": "competence",
"name": "Competence",
},
{"id": "theme", "name": "Domaine"},
{"id": "comment", "name": "Commentaire"},
{"id": "score_rate", "name": "Bareme"},
{"id": "is_leveled", "name": "Est_nivele"},
], ],
style_cell={ style_cell={
"whiteSpace": "normal", "whiteSpace": "normal",
"height": "auto", "height": "auto",
}, },
fixed_columns={"headers": True, "data": 7},
style_table={"minWidth": "100%"},
style_data_conditional=[], style_data_conditional=[],
editable=True, editable=True,
), ),
@ -379,7 +389,11 @@ def update_scores_table(csv, add_element, data):
) )
stack = stack.append(infos) stack = stack.append(infos)
return ( return (
[{"id": c, "name": c} for c in stack.columns], [
{"id": c, "name": c}
for c in stack.columns
if c not in ["Trimestre", "Nom", "Date"]
],
stack.to_dict("records"), stack.to_dict("records"),
highlight_value(stack), highlight_value(stack),
) )