소스 검색

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)