commented unused insert_row_data; moved commented insert one block up

This commit is contained in:
2026-06-09 11:33:45 +02:00
parent 82893c384a
commit 776ab04aed
+22 -22
View File
@@ -53,15 +53,6 @@ class aggridx(ui.aggrid):
self.ensure_column_defs(row)
self.extend_row_data([row])
# def insert(self, index, row):
# """
# insert row at the provided index
# append any missing columns on the right side of the table
# this operation maintains the current view on the data
# """
# self.ensure_column_defs(row)
# self.insert_row_data([row], index)
# def extend(self, rows):
# """
# append rows to the bottom of the table and
@@ -72,6 +63,15 @@ class aggridx(ui.aggrid):
# self.ensure_column_defs(columns)
# self.extend_row_data(rows)
# def insert(self, index, row):
# """
# insert row at the provided index
# append any missing columns on the right side of the table
# this operation maintains the current view on the data
# """
# self.ensure_column_defs(row)
# self.insert_row_data([row], index)
def ensure_column_defs(self, columns):
"""
@@ -108,22 +108,22 @@ class aggridx(ui.aggrid):
self.run_grid_method("applyTransaction", {"add": rows})
def insert_row_data(self, rows, index):
"""
insert rows at the provided index,
this operation maintains the current view on the data
"""
row_data = self.options["rowData"]
# def insert_row_data(self, rows, index):
# """
# insert rows at the provided index,
# this operation maintains the current view on the data
# """
# row_data = self.options["rowData"]
if index is None or index < 0 or len(row_data) <= index:
raise IndexError(f"index {index} is out of range")
# if index is None or index < 0 or len(row_data) <= index:
# raise IndexError(f"index {index} is out of range")
# update server without re-draw
with self.props.suspend_updates():
row_data[index:index] = rows
# # update server without re-draw
# with self.props.suspend_updates():
# row_data[index:index] = rows
# update client
self.run_grid_method("applyTransaction", {"add": rows, "addIndex": index})
# # update client
# self.run_grid_method("applyTransaction", {"add": rows, "addIndex": index})
def clear(self):