1
0
Falko Schindler 1 жил өмнө
parent
commit
eeca8b594f

+ 7 - 10
nicegui/elements/aggrid.py

@@ -80,9 +80,8 @@ class AgGrid(Element):
         rows = await self.get_selected_rows()
         rows = await self.get_selected_rows()
         return rows[0] if rows else None
         return rows[0] if rows else None
 
 
-
     async def get_client_data(self) -> List[Dict]:
     async def get_client_data(self) -> List[Dict]:
-        """Gets the data from the client including any edits made by the client.
+        """Get the data from the client including any edits made by the client.
 
 
         This method is especially useful when the grid is configured with ``'editable': True``.
         This method is especially useful when the grid is configured with ``'editable': True``.
 
 
@@ -90,20 +89,18 @@ class AgGrid(Element):
 
 
         :return: list of row data
         :return: list of row data
         """
         """
-        result = await run_javascript(
-            f"""
-            let rowData = [];
+        result = await run_javascript(f'''
+            const rowData = [];
             getElement({self.id}).gridOptions.api.forEachNode(node => rowData.push(node.data));
             getElement({self.id}).gridOptions.api.forEachNode(node => rowData.push(node.data));
             return rowData;
             return rowData;
-            """
-        )
+        ''')
         return cast(List[Dict], result)
         return cast(List[Dict], result)
 
 
     async def load_client_data(self) -> None:
     async def load_client_data(self) -> None:
-        """Obtains client data and updates the element's row data with it.
+        """Obtain client data and update the element's row data with it.
 
 
         This syncs edits made by the client in editable cells to the server.
         This syncs edits made by the client in editable cells to the server.
         """
         """
         client_row_data = await self.get_client_data()
         client_row_data = await self.get_client_data()
-        self.options["rowData"] = client_row_data
-        self.update()
+        self.options['rowData'] = client_row_data
+        self.update()