高手帮忙,实在找不出原因

yekong125 yekong125 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Extjs的combox组件没有办法加载数据
代码如下:
var deptselect = new Ext.data.Store({
reader:new Ext.data.JsonReader({
root:'root',
fields:['id','name']
}),
proxy:new Ext.data.HttpProxy({
url:'fbinfo.do?method=initDeptCombo'
})
});

var formpanel = Ext.create('InfoFB_FormPanel',{
layout:'form',
labelWidth:80,
labelAlign :'right',
items:[{
layout:'column',
frame:true,
items:[{
xtype:'combo',
id:'fbdept_id',
name:'fbdept',
hiddenName:'sub_fbdept',
columnWidth:.6,
allowBlank:false,
fieldLabel:'反馈科室',
emptyText:'--请选择--',
store:deptselect,
mode:'remote',
loadingText:'loading',
displayField:'name',
valueField:'id',
forceSelection:true,
typeAhead:true
}]
});

var infofbForm = function(){
var infofbWin = Ext.create('hosp.view.InfoFB',{
modal:true,
resizable :false,
constrain:true,
closeAction:'hide',
items:formpanel
});
infofbWin.show();
};
action部分:
public ActionForward initDeptCombo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
response.setContentType("text/html;charset=utf-8");
PrintWriter out = null;
BrowseSvr bssvr = null;
String json = "";
try{
bssvr = new BrowseSvrImp();
json = bssvr.initDeptCombo();
out = response.getWriter();
out.write(json); //json值:{"root":[{"id":"500","name":"网络管理科"}]}
System.out.println(json);
}catch(MyException e){
throw new MyException("初始化加载部门信息失败!");
}
out.flush();
out.close();

return null;
}
json值:{"root":[{"id":"500","name":"网络管理科"}]}
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
yekong125
JavaScript 87,983 成员 224,681 内容