Skip to content

Commit 1adacbd

Browse files
committed
Move aggrid temporarily to read data despite unmountedv (client-side)
1 parent 59fa942 commit 1adacbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nicegui/elements/aggrid/aggrid.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ async def get_client_data(
245245
}
246246
result = await self.client.run_javascript(f'''
247247
const rowData = [];
248+
if (getElement({self.id}) === undefined) {{
249+
mounted_app.elements[{self.client.content.id}].children.push({self.id});
250+
mounted_app.elements[{next(self.ancestors()).id}].children.pop({self.id});
251+
await mounted_app.$nextTick();
252+
mounted_app.elements[{self.client.content.id}].children.pop({self.id});
253+
mounted_app.elements[{next(self.ancestors()).id}].children.push({self.id});
254+
}}
248255
getElement({self.id}).api.{API_METHODS[method]}(node => rowData.push(node.data));
249256
return rowData;
250257
''', timeout=timeout)

0 commit comments

Comments
 (0)