Ext.data.Store 后台加载数据,加载不进去

//extjs版本4.0.7 代码如下:

Ext.define("Role",{

extend:"Ext.data.Model",

fields:[

 {name:'num',type:'string',min:1,max:8},

 {name:'name',type:'string',min:1,max:50},

 {name:'valid',type:'int',min:1,max:1},

 {name:'bz',type:'string'}

]

});

var arrayStore = new Ext.data.Store({

proxy :new Ext.data.HttpProxy({  

 url : '<%=basePath%>role.do?action=list'     

}),

reader : new Ext.data.JsonReader({

 model: 'Role'

})  

});

arrayStore.load();

//返回的数据

[

{"bz":"5","name":"角色5","num":"00000023","valid":1},

{"bz":"4","name":"角色4","num":"00000021","valid":1},

{"bz":"2","name":"角色3","num":"00000003","valid":1},

{"bz":"1","name":"角色2","num":"00000002","valid":1},

{"bz":"1","name":"角色1","num":"00000001","valid":1}

]
浏览器报错:
火狐 : this.model is undefined
IE : prototye is null

另外一种数据格式我也试过了:

[

['00000023','角色5',1,'5'],

['00000021','角色4',1,'4'],

['00000003','角色3',1,'2'],

['00000002','角色2',1,'1'],

['00000001','角色1',1,'1']

]

查看全部
myloveisnt
myloveisnt
2013/04/11 00:02
  • extjs
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

0个回复