前台:
表单必须含有name属性
if (action == 'edit' || action == 'show') { MyForm1.getForm().load({ url: '/data/customer/FollowHandler.ashx', params: { action: 'getModel', cusId: cusId }, success: function(g, h) { var e = Ext.decode(h.response.responseText).data; var startDate = e['Follow_date'].split('T'); Ext.getCmp("Follow_date").setValue(startDate[0]); }, failure: function (form, action) { Ext.Msg.alert("读取失败!", action.result.errorMessage); } }); }
后台:
Model.hr_employee model = bllEmp.GetModel(id); model.sex = model.sex == "男" ? "1" : "2";//下拉框 model.status = model.status == "在职" ? "1" : "2"; model.pwd = ""; context.Response.Write(JsonConvert.SerializeObject(new { success =true,data=model}));