Переглянути джерело

allow subscribing to table events #202

Falko Schindler 2 роки тому
батько
коміт
14c7309250
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      nicegui/elements/table.js

+ 4 - 0
nicegui/elements/table.js

@@ -6,6 +6,7 @@ export default {
       onGridReady: (params) => params.api.sizeColumnsToFit(),
     };
     this.grid = new agGrid.Grid(this.$el, this.gridOptions);
+    this.gridOptions.api.addGlobalListener(this.handle_event);
   },
   methods: {
     update_grid() {
@@ -15,6 +16,9 @@ export default {
     call_api_method(name, ...args) {
       this.gridOptions.api[name](...args);
     },
+    handle_event(event, args) {
+      this.$emit(event, args);
+    },
   },
   props: {
     options: Object,