reuse data_callback name if already set during first call to add_hooks
This commit is contained in:
parent
126a97191d
commit
8c01fdbfdc
@ -360,8 +360,11 @@ class DataEditor(NoSSRComponent):
|
||||
editor_id = get_unique_variable_name()
|
||||
|
||||
# Define the name of the getData callback associated with this component and assign to get_cell_content.
|
||||
data_callback = f"getData_{editor_id}"
|
||||
self.get_cell_content = Var(_js_expr=data_callback) # type: ignore
|
||||
if self.get_cell_content is not None:
|
||||
data_callback = self.get_cell_content._js_expr
|
||||
else:
|
||||
data_callback = f"getData_{editor_id}"
|
||||
self.get_cell_content = Var(_js_expr=data_callback) # type: ignore
|
||||
|
||||
code = [f"function {data_callback}([col, row])" "{"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user