I am displaying a pandas DataFrame called amdres. I have in my markdown `
I have a python function myedit that updates the table when someone edits a cell: `
def myedit(state: State, varname: str, action: str, payload: dict) -> bool:
state.amdres.loc[payload[“index”], payload[“col”]] = payload[“value”]
return True `
I have a global on_change function: `
def on_change(state: State, var_name: str, var_value: Any):
When I edit the cell and change the value, myedit() is called and the data contents of amdres are updated. But the UI does NOT update.
If I refresh the page in the browser, the new value is shown in the table.
Thanks for raising this issue. As you note, the unederlying data is updated but the table control does not automatically refresh. Taipy GUI is not “aware” of your edit as while the content of the DataFrame has changed, Taipy is still seeing the same DataFrame. Refreshing the browser causes Taipy to repopulate the table.
You are not doing anything wrong. If you would like to force Taipy GUI to refresh the table on edit, the simplest way is to make a copy of the DataFrame, edit that copy and replace the original with this “new” DataFrame In your example: