You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to access table keys simply by column name (str), as passed in table.add_columns().
fromtextual.appimportAppfromtextual.widgetsimportHeader, Footerfromtextual.widgetsimportDataTableclassTableTestApp(App):
defcompose(self):
"""Create child widgets for the app."""yieldHeader()
yieldDataTable(id='data_table')
yieldFooter()
defon_mount(self):
table: DataTable=self.query_one('#data_table', DataTable)
table.cursor_type='row'keys=table.add_columns('Status', 'File', 'Log', 'Run')
table.add_row('test', 'fn', 'log', 'run', key='test_key')
# It's great to have this way of updates - via text column as key#table.update_cell('test_key', 'File', 'foo')# This works finetable.update_cell('test_key', keys[1], 'foo')
if__name__=="__main__":
#print("Hello world")app=TableTestApp()
app.run()
It would be nice to be able to access table keys simply by column name (str), as passed in table.add_columns().
To be added by @willmcgugan
The text was updated successfully, but these errors were encountered: