{ xtype: 'textfield', name: 'selectcode', fieldLabel: '回访用户编号', width: '150', allowBlank: false, blankText: '必须填写!',
listeners: {
"blur": function() {
var usercode = form.getForm().getValues().selectcode;
var conn = Ext.lib.Ajax.getConnectionObject().conn;
conn.open("POST", String.format('/user/getuserbycode/{0}', usercode), false);
conn.send(null);
var respText = Ext.util.JSON.decode(conn.responseText);
if (respText) {
form.getForm().findField('UserName').setValue(respText.UserName); //传递到回访用户姓名
form.getForm().findField('CallUID').setValue(respText.ID); //传递到回访用户姓名
}
}
}
},
{ xtype: 'hidden', name: 'CallUID', hidden: false },
{ xtype: 'textfield', name: 'UserName', fieldLabel: '回访用户姓名', width: '150', readOnly: true },
后台:
public JsonResult GetUserByCode(string id)
{
return Json(t_UserBLL.GetItem(id), JsonRequestBehavior.AllowGet);
}