I'm having some trouble adding the kivymd MDDataTable
component as a child widget to a Screen in a .kv file. Keep getting a KeyError: 'container'
and AttributeError: 'super' object has no attribute '__getattr__
error. I've looked through the docs and multiple sites and everyone seems to be using some variant of the example found in the docs, which starts the component in the build method.
What I'm trying to say is if this works
class Example(MDApp):
def build(self):
screen = Screen()
data_tables = MDDataTable(
size_hint=(0.9, 0.6),
column_data=[
('Template Id', dp(30)),
('Name', dp(30))
],
row_data=[
('23lkjk33', 'Ayang Paul'),
('28ij399kk', 'Ringwa Justin')
]
)
screen.add_widget(data_tables)
return screen
Example().run()
then why doesn't this work
KV = '''
Screen:
MDDataTable:
size_hint: 0.9, 0.6
pos_hint: {"center_x": 0.5, "center_y": 0.5}
column_data: [('Template Id', dp(30)), ('Name', dp(30))]
row_data: [('23lkjk33', 'Ayang Paul'), ('28ij399kk', 'Ringwa Justin')]
'''
class Example(MDApp):
def build(self):
return Builder.load_string(KV)
Example().run()
???