فهرست منبع

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)