日期:2014-05-16  浏览次数:20662 次

Ext EditorGridPanel里面用combobox如何才能接受非下拉框的内容?
不知道我的描述明白不.我现在的定义是如下,出现的问题是.我只能选下拉框里面有的东西,能不能让此combobox能输入下拉列表不存在的东西.应该怎么做?谢谢
最好有简单的例子..再次感谢
JScript code
{
    header: "供应商",
    width: 250, 
    dataIndex: 'provider',
    editor: new Ext.form.ComboBox({ 
        id:'prvcombobox',
        typeAhead: true,
        listClass: 'x-combo-list-small',
        emptyText:'请选择', 
        displayField:'provider',
        selectOnFocus:true, 
        triggerAction: 'all', 
        store: store, 
        lazyRender:true
    })
}


------解决方案--------------------
那要加listeners

JScript code
    listeners:{
        focus:function(obj){
            var sm = oGrid.getSelectionModel();
            var rd = sm.getSelected();
            this.rdid = rd.id;
        },
        change:function(obj){
            var val = obj.getRawValue();
            var rd = oStore.getById(this.rdid);
            rd.set("provider", val);
            getDetail(val, this.rdid);
        }
    },

------解决方案--------------------
我是这么做的 
JScript code
var strGoupSelectBox=new Ext.form.ComboBox({
        typeAhead: true,
        triggerAction: 'all',
        lazyRender: true,
        transform:'prot_group',
        // -----------------------add by YDF at 2009-9-18 17:33:59
        id:'goupSelectBox',
        name:'goupSelectBox',
        valueField:"keyid",      // 提交表单时,下拉框的值
        displayField:'name',     // 显示在页面上下拉框的值
        emptyText:'请选择..',
        editable:false,
        store: new Ext.data.JsonStore({
          // 动态从后台提取数据并填充到 ComboBox
          autoLoad:true,
          fields: ['keyid', 'name'],
          url: '../data/sample_application_manager_getgroup_get_json.jsp',
          mathod:'post'
        }),
        listeners:{
            select:function(strGoupSelectBox,record,index){
                var groupValue = strGoupSelectBox.value;                
                alert(groupValue);    
                
        }}
    });