Parcourir la source

allow subscribing to table events #202

Falko Schindler il y a 2 ans
Parent
commit
14c7309250
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      nicegui/elements/table.js

+ 4 - 0
nicegui/elements/table.js

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