combo.js 908 B

1234567891011121314151617181920212223242526272829303132333435
  1. import _ from 'lodash'
  2. import {combo} from '../Defaults'
  3. import {baseConfig} from "./base";
  4. export default function () {
  5. const cc = Ext.form.field.ComboBox.prototype.constructor
  6. const {initComponent} = Ext.form.field.ComboBox.prototype
  7. Ext.form.field.ComboBox.override({
  8. constructor(config) {
  9. const newConfig = _.defaultsDeep({
  10. // 强制属性
  11. }, baseConfig(config, 'col-item'), config, combo)
  12. cc.call(this, newConfig)
  13. },
  14. initComponent() {
  15. this.on({
  16. focus: {
  17. // 获得焦点后自动下拉
  18. fn(sender) {
  19. sender.expand();
  20. this.doQuery(this.allQuery, true);
  21. },
  22. },
  23. })
  24. initComponent.call(this)
  25. },
  26. reload() {
  27. }
  28. });
  29. }