HI,
In order to be able to reuse some style elements from a dash_table.DataTable, I tried to inherit from DataTable but it fails brutally
here’s an exemple of code that doesn’t work:
`
-- coding: utf-8 --
import dash
import dash_table
app = dash.Dash(name)
class SubDatatable(dash_table.DataTable):
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
app.layout = SubDatatable(
id=‘table’,
columns=[{“name”: i, “id”: i} for i in [‘First’,‘Second’]],
data=[{‘First’:1,‘Second’:2}]
)
if name == ‘main’:
app.run_server(debug=True)
`
When I run this code, I get an exception (it looks like that there is an import problem at some point).
What am I doing wrong? Are there better method for ‘templating’ the DataTables than unheritance?
BTW, was unable to find how to quote code properly in my message. Is there any ‘Getting started’ for the forum?