Ext4.1 后台数据有返回,但是Grid不能显示数据。求大神指教! 本帖最后由 Foreign_Key 于 2015-02-02 16:30:04 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 store -> proxy- > reader -> root 这种格式的字符串需要配置Root属性items:[{"userName":"18565877864","userPwd":"000000","userMobilePhone":"15914005524","userAddr":"China","userParentID":3,"userAuthor":1099511562241,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp1","userPwd":"000000","userMobilePhone":"15914001003","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp2","userPwd":"000000","userMobilePhone":"15914001004","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":4}] 这种格式是不需要的。[{"userName":"18565877864","userPwd":"000000","userMobilePhone":"15914005524","userAddr":"China","userParentID":3,"userAuthor":1099511562241,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp1","userPwd":"000000","userMobilePhone":"15914001003","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp2","userPwd":"000000","userMobilePhone":"15914001004","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":4}] 如果你不想用root,需要extend Ext.data.reader.Json比如Ext.define('Ext.data.reader.JsonPWithoutRoot', { extend: 'Ext.data.reader.Json', read: function(response) { ... }, root: '...'}); 我加了root 数据还是不能显示。 json里面要配置root,你返回的json数据里面要有相应的root,比如你的reader里面有root:'data',那你的返回json字符串中应该是{data:[{},{}]}之类的 已经解决了。不是要配置Root的问题!我的理解还是这样{data:[{},{}]}这种格式的就要配置root,不是这种格式的可以不用配置。Ext4.0以上版本好像就是这样的。 郁闷中~~ 谁有《javascript高级程序设计第2版》pdf 非扫描 关于jQuery中的scrollTop方法 javascript能把%表示的字符(如%20表示空格)转换成正常的字符码? 关于WEB前端设计人员学习javascript的问题 新开帖再求JS 网页下拉列表框的问题 求教下拉列表问题!!! 请问谁那有关于js操作iframe的文章及例子? 如何实现树形结构,可以一层一层点了展开的,谢谢 jQuery怎么扩展方法...类似c#静态类那样的 栏位能具有附件上传或者文字描述功能
items:[{"userName":"18565877864","userPwd":"000000","userMobilePhone":"15914005524","userAddr":"China","userParentID":3,"userAuthor":1099511562241,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp1","userPwd":"000000","userMobilePhone":"15914001003","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp2","userPwd":"000000","userMobilePhone":"15914001004","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":4}]
这种格式是不需要的。
[{"userName":"18565877864","userPwd":"000000","userMobilePhone":"15914005524","userAddr":"China","userParentID":3,"userAuthor":1099511562241,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp1","userPwd":"000000","userMobilePhone":"15914001003","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":3},{"userName":"zfp2","userPwd":"000000","userMobilePhone":"15914001004","userAddr":"ChinaGuangdongShenZhen","userParentID":3,"userAuthor":0,"userIntroduce":"GpsServiceTesting","userType":4}]
需要extend Ext.data.reader.Json比如
Ext.define('Ext.data.reader.JsonPWithoutRoot', {
extend: 'Ext.data.reader.Json',
read: function(response) {
...
},
root: '...'
});
我加了root 数据还是不能显示。
已经解决了。
不是要配置Root的问题!
我的理解还是这样{data:[{},{}]}这种格式的就要配置root,
不是这种格式的可以不用配置。
Ext4.0以上版本好像就是这样的。