combox

var state_Store = new Ext.data.SimpleStore({
        fields : ['txt','val'],
        data : [['正常','0'],['异常','1'],['紧急','2']]
    });
   
    var _state = new Ext.form.ComboBox({
        name : 'dangerState',
        fieldLabel : '状态',
        width : 200,
        value : dangerState,
        editable:false,
          store: state_Store, 
          mode: 'local',  
          triggerAction: 'all',
          selectOnFocus : true,//用户不能自己输入,只能选择列表中有的记录  
          valueField : 'val',  
          displayField : 'txt'
    });

你可能感兴趣的:(ext)