EXT的formfield中combo下拉框为textfield赋值

来源:互联网 发布:什么是网络推广 编辑:程序博客网 时间:2024/05/19 12:12
{columnWidth : 0.2,layout : 'form',labelWidth : 70,items : {fieldLabel : '维修材料',    //repair_material        width : 70,                  name  : 'repair_material',                  xtype:'combo',                  editable : false,                  mode  :'local',                    triggerAction:'all',                   allowBlank:false,                  store : matStore,                     displayField: 'cname',                   valueField  : 'cid',                 //emptyText:'无',//默认值                 listeners:{                       select : function(combo, record,index){                  //alert(record.data.cid);                 //alert(combo.value);                    Ext.Ajax.request({url: 'warrantyServiceAction!selectDanwei.shtml',method: 'POST',params: {material_name_test:record.data.cname},      success: function(response) {//alert(response.responseText);if(response.responseText=="null"){Ext.getCmp("repair_danwei").setValue("无");}else{Ext.getCmp("repair_danwei").setValue(response.responseText);}}});             },            /*                render:function(obj) {                                              var fontNew = document.createElement("font");                                              fontNew.setAttribute("color","black");                                              var redStar = document.createTextNode('小时');                                              fontNew.appendChild(redStar);                                             obj.el.dom.parentNode.appendChild(fontNew);                                          }                                         */           }                                           }},{columnWidth : 0.2,layout : 'form',labelWidth : 30,items : {fieldLabel : '单位',    //repair_material width : 70,                                      name  : 'repair_danwei',                                      id: 'repair_danwei',                                    xtype:'textfield',                                      editable : false,                                      readOnly:true            }        },       

原创粉丝点击