Extjs中combobox 在toolbar上显示

2025-05-13 17:31:53
推荐回答(1个)
回答(1):

在tbar上没有什么特殊啊~~~

简单写了一个

Ext.onReady(function() {
 var genus_store = new Ext.data.SimpleStore( {
  fields : [ 'value', 'text' ],
  data : [ [ 'ZZ', '证照' ], [ 'ZX', '照相' ], [ 'LX', '录像' ],
    [ 'LY', '录音' ], [ 'RY', '荣誉实物' ], [ 'YZ', '印章' ] ]
 });
 var form_condition = new Ext.FormPanel( {
  split : false,
  labelWidth : 80,
  frame : true,
  width : 275,
  defaults : {
   width : 150
  },
  labelAlign : 'right',
  defaultType : 'textfield',
  autoScroll : true,
  tbar:[{
     xtype : 'combo',  
      name : 'genus',
     id : 'genus_id',
     mode : 'local',
     readOnly : false,
     triggerAction : 'all',
     emptyText : '属类',
     store : genus_store,
     hiddenName : 'genus',
     valueField : 'value',
     displayField : 'text'
    }]
 });
    
 var win = new Ext.Window( {
  title : '登录',
  width : 340,
  height : 230,
  layout : "fit",
  plain : true,
  modal : true,
  closeAction : "hide",
  items : [ form_condition ]
 });
 win.show();
});