瀏覽代碼

add table.call_api_method

Falko Schindler 2 年之前
父節點
當前提交
8cc65a4252
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 3 0
      nicegui/elements/table.js
  2. 3 0
      nicegui/elements/table.py

+ 3 - 0
nicegui/elements/table.js

@@ -12,6 +12,9 @@ export default {
       replaceObject(this.options, this.gridOptions);
       this.gridOptions.api.refreshCells();
     },
+    call_api_method(name, ...args) {
+      this.gridOptions.api[name](...args);
+    },
   },
   props: {
     options: Object,

+ 3 - 0
nicegui/elements/table.py

@@ -27,3 +27,6 @@ class Table(Element):
     def update(self) -> None:
         super().update()
         self.run_method('update_grid')
+
+    def call_api_method(self, name: str, *args) -> None:
+        self.run_method('call_api_method', name, args)