Hi. I am using a DataTable wiht a bunch of styles.
The table is using
row_selectable='multi'
and I would additionally like to change the style_data_conditional to highlight selected rows. What is the conditional for ‘is selected’ and how can I combine this with my current conditional?
I can only find a state selected which seems to refer to selected cells in editable tables.
style_cell = {'textAlign': 'left',}
style_cell_conditional = [
{'if': {'column_id': c}, 'width': '200px'} for c in cols_wide
] + [
{'if': {'column_id': c}, 'width': '100px', 'textAlign': 'center',} for c in cols_ctr
] + [
{'if': {'column_id': c}, 'width': '80px', 'textAlign': 'right'} for c in cols_reg
]
style_data_conditional = [{'if': {'row_index': 'even'},'backgroundColor': 'rgb(230, 245, 255)'}]
style_header = {'backgroundColor': 'rgb(160, 220, 255)','fontWeight': 'bold'}
dtbl.DataTable(id='table',
columns=tcols,
style_cell=style_cell,
style_cell_conditional=style_cell_conditional,
style_data_conditional=style_data_conditional_alert,
style_header=style_header_alert,
data=[],
filter_action="native",
sort_action="native",
sort_mode="multi",
row_selectable='multi'
),