Browse Source

add more table event arguments #202

Falko Schindler 2 năm trước cách đây
mục cha
commit
d76cbcffc1
1 tập tin đã thay đổi với 33 bổ sung2 xóa
  1. 33 2
      nicegui/elements/table.js

+ 33 - 2
nicegui/elements/table.js

@@ -16,8 +16,39 @@ export default {
     call_api_method(name, ...args) {
       this.gridOptions.api[name](...args);
     },
-    handle_event(event, args) {
-      this.$emit(event, args);
+    handle_event(type, args) {
+      this.$emit(type, {
+        value: args.value,
+        oldValue: args.oldValue,
+        newValue: args.newValue,
+        context: args.context,
+        rowIndex: args.rowIndex,
+        data: args.data,
+        toIndex: args.toIndex,
+        firstRow: args.firstRow,
+        lastRow: args.lastRow,
+        clientWidth: args.clientWidth,
+        clientHeight: args.clientHeight,
+        started: args.started,
+        finished: args.finished,
+        direction: args.direction,
+        top: args.top,
+        left: args.left,
+        animate: args.animate,
+        keepRenderedRows: args.keepRenderedRows,
+        newData: args.newData,
+        newPage: args.newPage,
+        source: args.source,
+        visible: args.visible,
+        pinned: args.pinned,
+        filterInstance: args.filterInstance,
+        rowPinned: args.rowPinned,
+        forceBrowserFocus: args.forceBrowserFocus,
+        colId: args.column?.colId,
+        selected: args.node?.selected,
+        rowHeight: args.node?.rowHeight,
+        rowId: args.node?.id,
+      });
     },
   },
   props: {