Dash DataTable - Using Callbacks


How do you use dash-table-experiments together with callback functions?

The code below works for the table without callback, but when I included the call back functionality it does not work, (I get a “Error loading dependencies error”).

import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_table_experiments as dt
import pandas

app = dash.Dash()

DF_SIMPLE = pandas.DataFrame({
‘x’: [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’],
‘y’: [4, 3, 1, 2, 3, 6],
‘z’: [‘a’, ‘b’, ‘c’, ‘a’, ‘b’, ‘c’]

app.layout = html.Div(

@app.callback(Output(‘datatable-not-working’, ‘rows’))
def update_info_table():
return DF_SIMPLE

if name == ‘main’:

Display tables in Dash

I think DataTable is unhappy with rows not having an initial value. dt.DataTable(id=‘datatable-not-working’, rows=[{}]) makes it happy.


That totally worked. Thanks! :smiley: