Selaa lähdekoodia

grid.getDataRows

luoyifan 3 vuotta sitten
vanhempi
commit
97221792e5
1 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  1. 8 1
      src/controls/grid.js

+ 8 - 1
src/controls/grid.js

@@ -218,7 +218,7 @@ export default function () {
          */
         removeEditRow(record) {
             if (!record) {
-                record = this.refs.grid2.selection
+                record = this.selection
             }
 
             if (!record) {
@@ -229,6 +229,13 @@ export default function () {
             this.getStore().remove(record)
         },
 
+        /**
+         * 获取全部原始数据
+         */
+        getDataRows() {
+            return this.getStore().data.items.map(r => r.data)
+        },
+
         _transform(data) {
             // 无论是 grid._setDataReal 还是 stores.gridInvokeBuild 都会走这个函数,设值前都可以改变表格值
             _.forEach(data, row => {