|
@@ -1,5 +1,5 @@
|
|
|
import _ from 'lodash'
|
|
|
-import {lookupScope} from "../lib/lib";
|
|
|
+import {lookupScope, lookupFn} from "../lib/lib";
|
|
|
import {serverInvokeUrlTransform, apiConvert} from "../lib/config";
|
|
|
import {calcObjectFlat} from '../lib/systemLib'
|
|
|
|
|
@@ -27,7 +27,17 @@ export function gridInvokeBuild(scope, grid, config, dataSource, reloadParams =
|
|
|
rootProperty: 'data',
|
|
|
totalProperty: 'pagination.total',
|
|
|
successProperty: 'success',
|
|
|
- messageProperty: 'msg'
|
|
|
+ messageProperty: 'msg',
|
|
|
+ transform: function (data) {
|
|
|
+ if (grid.dataTransform) {
|
|
|
+ if (typeof grid.dataTransform === 'string') {
|
|
|
+ grid.dataTransform = lookupFn(lookupScope(grid), grid.dataTransform)
|
|
|
+ }
|
|
|
+
|
|
|
+ return grid.dataTransform.call(grid, data)
|
|
|
+ }
|
|
|
+ return data
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
listeners: {
|