I’m trying to limit the number of rows the user can select in a Datatable. However, it seems that auto-callbacks like this one are impossible (here, with a limit of 20):
@app.callback(Output('table', 'selected_row_indices'),
[Input('table', 'selected_row_indices')])
def limit_row_indices(indices):
if indices is not None:
if len(indices>20):
return indices[:20]
I understand that this prevents entering into an infinite loop. But is there a working solution to limit the number of rows selected by the user?