这是显示部分
var store=new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: 'getUserData.jsp'
}),
//url:'http://design/getUserData.jsp',
reader: new Ext.data.JsonReader(
{fields:['username','usergroup']}
)
/* fields:[
{name:'username'},
{name:'usergroup'}]
*/
});
store.load();
var gridPanel=new Ext.grid.GridPanel({
store:store,
columns:[
/*{
header:'用户ID',
dataIndex:'id',
width:100
},*/
{
header:'用户名',
dataIndex:'username',
width:160
},{
header:'用户组',
dataIndex:'usergroup',
width:160
}],
viewConfig:{
sortAscText:'正序排列',
sortDescText:'逆序排列',
forceFit:true
},
width:600,
height:400,
frame:true,
//title:'Framed with Checkbox Selection and Horizontal Scrolling',
iconCls:'icon-grid'
});
下面是数据,读取的页面的内容没有html,head和body标签,只有
[
{"username":"aaa","usergroup":"bbb"},
{"username":"bbb","usergroup":"111"}
]
我试过直接在store用data属性直接给值,显示正常,但是一旦到网页去取,就取不到值
现在死活拿不到值,试过很多方法了