Hi Jan and others
I know this post is a bit old, but I saw it while researching my own problem, came to my own solution and thought Iād shareā¦
So I also have a data grid with pretty cool data grid rows that are pretty dynamic and do a lot of things on their own depending on many variables, which results in an awesome presentation of data to the user. Only drawback is that when line is added, the standard
repeating_panel.items = updated_list
results in an irritating 2-3 seconds of waiting while each line starts its own data grid row from scratch.
My solution? Initiate the data grid row yourself, then add it to the data grid using add_components. Near instantaneous!
So lets say you have a data grid called data_grid_1, with a data row template called data_row.
Go to the data_row and add an argument such as:
class data_row(data_rowTemplate):
def __init__(self, new=None,**properties):
ānewā is where we will send the new item, instead of adding it to the repeating panelās items.
So from the form where your data grid is:
from .data_row import data_row
new_line_info = {'one':1,'two':2}
my_new_line = data_row(new=new_line_info)
data_grid.add_component(my_new_line,index=1)
(index must be 1 because the columns (if youāre using them) are at 0)
Remember that youāll have to amend the first few lines of data_row:
if new:
self.item = new
Viola! Enjoy