|
@@ -1,13 +1,35 @@
|
|
|
+import _ from 'lodash'
|
|
|
+import {combo} from '../Defaults'
|
|
|
+import {invokeMethod} from "../utils";
|
|
|
+import {baseConfig} from "./base";
|
|
|
+
|
|
|
export default function () {
|
|
|
- const initComponentOrgin = Ext.form.field.ComboBox.prototype.initComponent
|
|
|
+ const cc = Ext.form.field.ComboBox.prototype.constructor
|
|
|
+ const {initComponent} = Ext.form.field.ComboBox.prototype
|
|
|
Ext.form.field.ComboBox.override({
|
|
|
- initComponent: function () {
|
|
|
- if (this.allowBlank === false || this.validateBlank === true) {
|
|
|
- this.beforeLabelTextTpl = [
|
|
|
- '<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
|
|
|
- ];
|
|
|
- }
|
|
|
- initComponentOrgin.call(this)
|
|
|
+ constructor(config) {
|
|
|
+ const newConfig = _.defaultsDeep({
|
|
|
+ // 强制属性
|
|
|
+ }, baseConfig(config, 'col-item'), config, combo)
|
|
|
+
|
|
|
+ cc.call(this, newConfig)
|
|
|
+ },
|
|
|
+
|
|
|
+ initComponent() {
|
|
|
+ this.on({
|
|
|
+ focus: {
|
|
|
+ fn(sender) {
|
|
|
+ sender.expand();
|
|
|
+ this.doQuery(this.allQuery, true);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+
|
|
|
+ initComponent.call(this)
|
|
|
+ },
|
|
|
+
|
|
|
+ reload() {
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|