|
@@ -0,0 +1,57 @@
|
|
|
+import _ from 'lodash'
|
|
|
+import {grid} from '../Defaults'
|
|
|
+import {baseConfig} from "./base";
|
|
|
+import {dataSourceReload} from "../DataSourceHelper";
|
|
|
+
|
|
|
+export default function () {
|
|
|
+ const cc = Ext.grid.Panel.prototype.constructor
|
|
|
+ const {initComponent, setData} = Ext.grid.Panel.prototype
|
|
|
+ Ext.grid.Panel.override({
|
|
|
+ constructor(config) {
|
|
|
+ const newConfig = _.defaultsDeep({
|
|
|
+ // 强制性属性
|
|
|
+
|
|
|
+ }, baseConfig(config, 'row-item'), config, grid)
|
|
|
+
|
|
|
+
|
|
|
+ cc.call(this, newConfig)
|
|
|
+ },
|
|
|
+
|
|
|
+ setLoading(value) {
|
|
|
+ if (value) {
|
|
|
+ this.mask()
|
|
|
+ } else {
|
|
|
+ this.unmask()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // reload() {
|
|
|
+ // dataSourceReload(this)
|
|
|
+ // },
|
|
|
+
|
|
|
+ initComponent() {
|
|
|
+ const that = this
|
|
|
+ this.on({
|
|
|
+ afterrender() {
|
|
|
+ const {config} = this
|
|
|
+
|
|
|
+ // if (config.dataSource && config.autoLoad) {
|
|
|
+ // dataSourceReload(this)
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ destory() {
|
|
|
+ },
|
|
|
+ // focus: {
|
|
|
+ // // 获得焦点后自动下拉
|
|
|
+ // fn(sender) {
|
|
|
+ // sender.expand();
|
|
|
+ // this.doQuery(this.allQuery, true);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ })
|
|
|
+
|
|
|
+ initComponent.call(this)
|
|
|
+ },
|
|
|
+
|
|
|
+ });
|
|
|
+}
|