|
@@ -14,6 +14,7 @@ import {
|
|
|
YvBase
|
|
|
} from "../PropertyDescriptionTable";
|
|
|
import {PropertyDescription} from "../PropertyDescription";
|
|
|
+import {gridInvokeBuild} from "./stores";
|
|
|
|
|
|
export default function () {
|
|
|
|
|
@@ -199,33 +200,9 @@ export default function () {
|
|
|
// this.store.reload({aaaa: 1, bbbb: 2})
|
|
|
// }
|
|
|
const {dataSource} = config
|
|
|
- if (_.isPlainObject(dataSource) && dataSource.method === 'invoke' && !window["IS_DESIGN_MODE"]) {
|
|
|
+ if (_.isPlainObject(dataSource) && !window["IS_DESIGN_MODE"]) {
|
|
|
const scope = lookupScope(me)
|
|
|
-
|
|
|
- const params = calcObjectFlat(scope.viewModel.data, dataSource.params)
|
|
|
- me.setStore(new Ext.data.Store({
|
|
|
- remoteSort: config.remoteSort,
|
|
|
- remoteFilter: config.remoteFilter,
|
|
|
- autoLoad: true,
|
|
|
- proxy: {
|
|
|
- type: 'jsonAjax',
|
|
|
- $owner: me,
|
|
|
- url: serverInvokeUrlTransform(dataSource.url),
|
|
|
- extraParams: _.defaultsDeep({}, reloadParams, params),
|
|
|
- reader: {
|
|
|
- type: 'json',
|
|
|
- rootProperty: 'data',
|
|
|
- totalProperty: 'pagination.total',
|
|
|
- successProperty: 'success',
|
|
|
- messageProperty: 'msg'
|
|
|
- }
|
|
|
- },
|
|
|
- listeners: {
|
|
|
- load: function (store, records, successful, operation) {
|
|
|
- me.fireEvent('dataLoadComplete', me, successful, records);
|
|
|
- }
|
|
|
- }
|
|
|
- }))
|
|
|
+ gridInvokeBuild(scope, me, config, dataSource, reloadParams)
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -249,7 +226,7 @@ export default function () {
|
|
|
if (config.dataSourceCallbackFn) {
|
|
|
me.reload()
|
|
|
|
|
|
- } else if (_.isPlainObject(dataSource) && dataSource.method === 'invoke') {
|
|
|
+ } else if (_.isPlainObject(dataSource)) {
|
|
|
me.reload()
|
|
|
}
|
|
|
}
|