Add row to top of data grid without refreshing

If you want to add to a row in the repeating panel, you could modify its items.

Try inspecting self.repeating_panel_1.items. It is a list of dictionaries/rows.

If you want to add a data row panel, could you use add_component and rearrange the full component list?

Example,

label=Label(text='put me first')

row=DataRowPanel()
row.add_component(label, column=1)

comps=self.data_grid_1.get_components()
comps.insert(1, row)

self.data_grid_1.clear()

for c in comps:
  self.data_grid_1.add_component(c)

I’m not sure if there is another way to do this without having to clear and then re-add components.

1 Like