I am displaying a pandas DataFrame called amdres
. I have in my markdown
`
<|{amdres}|table|height=400px|width=500px|on_edit=myedit|>
`
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):
print(“changed”)
`
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.
Am I doing something wrong?