DoubleField.js 1.2 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. *两个字段合并成一个字段显示
  3. */
  4. Ext.define('erp.view.core.form.DoubleField', {
  5. extend: 'Ext.form.field.Base',
  6. alias: 'widget.doublefield',
  7. height: 22,
  8. firstname: '',//第一个字段
  9. firstxtype: '',
  10. secondname: '',//另外的一个字段
  11. secondxtype: '',
  12. fieldSubTpl: [
  13. '<input id="{id}" type="{type}" ',
  14. '<tpl if="name">name="{name}" </tpl>',
  15. '<tpl if="size">size="{size}" </tpl>',
  16. '<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>',
  17. 'class="{fieldCls} {typeCls}" autocomplete="off" />',
  18. {
  19. compiled: true,
  20. disableFormats: true
  21. }
  22. ],
  23. initComponent : function(){
  24. this.callParent(arguments);
  25. this.items = [{xtype: this.firstxtype, name: this.firstname, width: this.width*0.4, allowBlank: true},
  26. {xtype: 'displayfield', value: '('},
  27. {xtype: 'textfield', name: this.secondname, width: this.width*0.4, allowBlank: true},
  28. {xtype: 'displayfield', value: ')'}];
  29. }
  30. });