Ext.form.ComboBox 空选择解决方案

 
var _testComboBox = new Ext.form.ComboBox({
      hiddenName : "test",
      displayField : "test",
      fieldLabel : "测试",
      width : 100,
      mode : "local",
      readOnly : true,
      triggerAction : "all",
      listeners : {
       'select' : {
        fn : function() {
         if (_testComboBox.getValue() == " ") {
          _testComboBox.setValue("")
         }
        },
        scope : this
       }
      },
      store : new Ext.data.SimpleStore({
         fields : ["test"],
         data : [[" "], ["1"], ["2"]]
        })
     });
   var _form = new Ext.FormPanel({
      items : _testComboBox
     })

var test = new Ext.Window({
      title : "<center><font size=2>测试</font></center>",
      closeAction : 'hide',
      layout : 'border',
      width : 850,
      height : 500,
      draggable : false,
      resizable : false,
      items : [{
         region : 'center',
         frame : true,
         items : _form }]
     }).show()

 


 

你可能感兴趣的:(ext)