【代awptony发帖】Ext combox 数据不显示 -----MADE,哥要崩溃了,搞了一下午还是没数据!!
不小心删除了
awptony用户发的帖子,对不起啊。。
这个帖子我代awptony重新发过。。
//服务器返回json 数据
{"totalCount":8,"list":[{"emps":1,"roleid":1,"roleName":"超级管理员"},{"emps":1,"roleid":2,"roleName":"管理员"},{"emps":2,"roleid":3,"roleName":"普通员工"},{"emps":0,"roleid":4,"roleName":"商户"},{"emps":1,"roleid":5,"roleName":"aa"},{"emps":0,"roleid":16,"roleName":"321"},{"emps":0,"roleid":17,"roleName":"zhidan"},{"emps":0,"roleid":18,"roleName":"zhan"}]}
//js
Ext.onReady(function() {
var cityReader = new Ext.data.JsonReader({
totalProperty:'totalCount',
root:'list',
}
[{name:'rId',mapping:'roleid'},{name:'rName',mapping:'roleName'}]);
var cityStore = new Ext.data.SimpleStore({
proxy:new Ext.data.HttpProxy({
type:'ajax',
url:'role_findRoleByPage.action',
method:'get'
}),
reader:cityReader,
});
var cityCom = new Ext.form.ComboBox({
// colspan : 2,
fieldLabel : '日志类型',
store : cityStore,
displayField : 'rName',
valueField : 'rId',
// mode : 'local',
triggerAction : 'all',
width : 400,
height:400,
emptyText : '请选择 .... ',
});
logDataType.load();
var mainPanel= new Ext.Panel({
renderTo:document.body,
// border:false,
width:700,
height:700,
items:[cityCom],
})
});
上面是从百度的快照中找出的代码,如果楼主没贴错那么语法有问题。。其他没测试。
var cityReader = new Ext.data.JsonReader({
totalProperty:'totalCount',
root:'list'/////////, ///这里多了个,
}
,/////////////这里少了
[{name:'rId',mapping:'roleid'},{name:'rName',mapping:'roleName'}]);
------解决方案--------------------版主,你让我情何以堪?!
------解决方案--------------------