var combo_tyfs = new Ext.form.ComboBox({
        store:tyfs_Store,
        id:'tyfs_add',
        name:'tyfs_add',
        hiddenName:'com_tyfshidden',
        fieldLabel:'托运方式',
        width:85,
        typeAhead: true,
        emptyText:'请选择...',
        triggerAction:'all',
        valueField:'id',
        displayField:'name',
        selectOnFocus:true,
        allowBlank:false,
        hiddenValue:01,
        value:'汽运普件',
        mode:'remote',
        blankText:'请选择托运方式',
        listeners:{
            'blur':function(f){                 
                 var tyfsbm = Ext.getCmp("tyfs_add").getRawValue();
                 Ext.Ajax.request({
                    url:"data/jydbh/getTyfsbm.aspx?tyfsbm="+tyfsbm,
                    success:function(response){
                        var tmp = response.responseText.split("|");
                        if(tmp!=""){
                            AddPublishForm.getForm().findField("tyfs_add").setValue(tmp[1]);
                        }
                        else
                        {
                            //Ext.MessageBox.alert("提示信息","查无此编码");
                            //AddPublishForm.getForm().findField("tyfs_add").setValue(Ext.getCmp("");
                            f.setValue(f.getEl().dom.value);
                        }
                        
                    }
                 })
            }
        }
    });  
回车后 没有反应  
需要用鼠标点击一下空白处 combox才会赋值????
不知道为何? 谁给看看?谢谢分别换了'change' ,focus ‘select’都不行

解决方案 »

  1.   

    blur 你写的这个事件,就是说,光标离开后才执行。就出现了楼主所说的原因了、
      

  2.   

    success:function(response){
      var tmp = response.responseText.split("|");
      if(tmp!=""){
      AddPublishForm.getForm().findField("tyfs_add").setValue(tmp[1]);
      }
      else
      {
      //Ext.MessageBox.alert("提示信息","查无此编码");
      //AddPublishForm.getForm().findField("tyfs_add").setValue(Ext.getCmp("");
      f.setValue(f.getEl().dom.value);
      }
    你这个ajax方法是好的?这个response返回的值好像没用到?
      

  3.   

    var tmp = response.responseText.split("|");
    就是这个啊 用来接收返回值 返回值用"|"分割开
    tmp[0],tmp[1]