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
Describe the bug
on cell change can be used to grab curtain changes and set to something else programmatically. This however does not work with nested rows and columns for some reason...
def on_cell_changed(cell):
if float(cell['value']) == 15.0:
simple_grid.set_cell_value_by_index(0,0, -15)
print(
"Cell at primary key {row} and column '{column}' ({column_index}) changed to {value}".format(
row=cell["row"],
column=cell["column"],
column_index=cell["column_index"],
value=cell["value"],
)
)
simple_grid = ipg.DataGrid(
simple_df,
layout={"height": "150px"},
editable=True,
)
simple_grid.on_cell_change(on_cell_changed)
simple_grid
Change the first cell to 15, and it will be changed to -15 as well as the dataframe behind
Problem
Doing the same with the nested_grid does not work
def on_cell_changed(cell):
def on_cell_changed(cell):
if float(cell['value']) == 15.0:
nested_grid.set_cell_value_by_index(cell["row"],cell["column_index"], -15)
print('set value')
print(
"Cell at primary key {row} and column '{column}' ({column_index}) changed to {value}".format(
row=cell["row"],
column=cell["column"],
column_index=cell["column_index"],
value=cell["value"],
)
)
nested_grid = ipg.DataGrid(
nested_df,
layout={"height": "150px"},
editable=True,
)
nested_grid.on_cell_change(on_cell_changed)
nested_grid
Environment (please complete the following information):
Ubuntu 22.40
jupyterlab 4.2.0
ipydatagrid 1.3.1
The text was updated successfully, but these errors were encountered:
TermeHansen
changed the title
data and and view not updating when using nested rows and columns
data and view not updating when using nested rows and columns
May 13, 2024
Describe the bug
on cell change can be used to grab curtain changes and set to something else programmatically. This however does not work with nested rows and columns for some reason...
To Reproduce
Based on nested hierarchies example (https://github.com/bloomberg/ipydatagrid/blob/main/examples/Nested%20Hierarchies.ipynb):
Expected behavior
Simple grid works as expected:
Change the first cell to 15, and it will be changed to -15 as well as the dataframe behind
Problem
Doing the same with the nested_grid does not work
def on_cell_changed(cell):
Environment (please complete the following information):
Ubuntu 22.40
jupyterlab 4.2.0
ipydatagrid 1.3.1
The text was updated successfully, but these errors were encountered: