'DataTable - get row_ids of displayed data on page

I use pagination (10 rows per page). I would like to get via a callback the row ids of rows which are displayed on the current page.

I found the 'derived_viewport_row_ids' attributes promising, but it results in a list of Nones.

@app.callback(Output('main-table','style_data_conditional'), Input('main-table','derived_viewport_row_ids'), prevent_initial_call=True)
def gradient_style(page_row_ids):
    print(page_row_ids)
    return no_update

Does anybody have an idea how to access this information?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source