extjs遍历json集合问题-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

extjs遍历json集合问题

2016-07-07 16:55:36 1727 1
后台使用级联查询两个表数据,向前段输出一个json集合,前台应该如何接收该json集合,以及前台如何将json遍历出来?
 附上json格式:{"datas":[{"cash":123,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":2,"month":3,"nanos":0,"seconds":31,"time":1460199751000,"timezoneOffset":-480,"year":116},"id":"402881e953fa67fe0153faaffeb30003","modifyDate":null,"state":false,"statu":1},{"cash":123,"consumerId":"402881e953ae826f0153ae82ddf10001","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":3,"month":3,"nanos":0,"seconds":53,"time":1460199833000,"timezoneOffset":-480,"year":116},"id":"402881e953fa67fe0153fab140a50004","modifyDate":null,"state":true,"statu":1},{"cash":123,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":5,"month":3,"nanos":0,"seconds":20,"time":1460199920000,"timezoneOffset":-480,"year":116},"id":"402881e953fa67fe0153fab295170005","modifyDate":null,"state":true,"statu":1},{"cash":123,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":7,"month":3,"nanos":0,"seconds":22,"time":1460200042000,"timezoneOffset":-480,"year":116},"id":"402881e953fa67fe0153fab471bd0006","modifyDate":null,"state":true,"statu":1},{"cash":123,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":8,"month":3,"nanos":0,"seconds":59,"time":1460200139000,"timezoneOffset":-480,"year":116},"id":"402881e953fab5660153fab5ebeb0000","modifyDate":null,"state":true,"statu":1},{"cash":123,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":10,"month":3,"nanos":0,"seconds":20,"time":1460200220000,"timezoneOffset":-480,"year":116},"id":"402881e953fab5660153fab727a40001","modifyDate":{"date":9,"day":6,"hours":19,"minutes":10,"month":3,"nanos":0,"seconds":20,"time":1460200220000,"timezoneOffset":-480,"year":116},"state":true,"statu":1},{"cash":100,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":11,"month":3,"nanos":0,"seconds":23,"time":1460200283000,"timezoneOffset":-480,"year":116},"id":"402881e953fab5660153fab81cac0002","modifyDate":{"date":9,"day":6,"hours":19,"minutes":11,"month":3,"nanos":0,"seconds":23,"time":1460200283000,"timezoneOffset":-480,"year":116},"state":true,"statu":1},{"cash":100,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":9,"day":6,"hours":19,"minutes":12,"month":3,"nanos":0,"seconds":30,"time":1460200350000,"timezoneOffset":-480,"year":116},"id":"402881e953fab5660153fab9224c0003","modifyDate":{"date":9,"day":6,"hours":19,"minutes":12,"month":3,"nanos":0,"seconds":30,"time":1460200350000,"timezoneOffset":-480,"year":116},"state":true,"statu":1},{"cash":50,"consumerId":"402881e953ae826f0153ae82ddf10001","consumers":[],"createDate":{"date":7,"day":4,"hours":14,"minutes":36,"month":3,"nanos":0,"seconds":41,"time":1460011001000,"timezoneOffset":-480,"year":116},"id":"402881f353ef64290153ef6fe8010000","modifyDate":{"date":9,"day":6,"hours":19,"minutes":1,"month":3,"nanos":0,"seconds":34,"time":1460199694000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":123,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":14,"minutes":39,"month":3,"nanos":0,"seconds":53,"time":1460011193000,"timezoneOffset":-480,"year":116},"id":"402881f353ef64290153ef72d4be0001","modifyDate":{"date":8,"day":5,"hours":9,"minutes":38,"month":3,"nanos":0,"seconds":59,"time":1460079539000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":123,"consumerId":"402881e953ae826f0153ae82ddf10001","consumers":[],"createDate":{"date":7,"day":4,"hours":18,"minutes":25,"month":3,"nanos":0,"seconds":12,"time":1460024712000,"timezoneOffset":-480,"year":116},"id":"402881f353f02eaa0153f0411e0c0000","modifyDate":{"date":8,"day":5,"hours":18,"minutes":25,"month":3,"nanos":0,"seconds":12,"time":1460111112000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":31,"month":3,"nanos":0,"seconds":47,"time":1460032307000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b502e90000","modifyDate":{"date":8,"day":5,"hours":20,"minutes":39,"month":3,"nanos":0,"seconds":14,"time":1460119154000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":33,"month":3,"nanos":0,"seconds":6,"time":1460032386000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6344d0001","modifyDate":{"date":8,"day":5,"hours":20,"minutes":39,"month":3,"nanos":0,"seconds":24,"time":1460119164000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":33,"month":3,"nanos":0,"seconds":17,"time":1460032397000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b65f3a0002","modifyDate":{"date":7,"day":4,"hours":9,"minutes":51,"month":3,"nanos":0,"seconds":34,"time":1459993894000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":33,"month":3,"nanos":0,"seconds":49,"time":1460032429000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0003","modifyDate":{"date":7,"day":4,"hours":20,"minutes":33,"month":3,"nanos":0,"seconds":49,"time":1460032429000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":34,"month":3,"nanos":0,"seconds":39,"time":1460032479000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0004","modifyDate":{"date":9,"day":6,"hours":19,"minutes":0,"month":3,"nanos":0,"seconds":43,"time":1460199643000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":34,"month":3,"nanos":0,"seconds":55,"time":1460032495000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0005","modifyDate":{"date":9,"day":6,"hours":19,"minutes":0,"month":3,"nanos":0,"seconds":40,"time":1460199640000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":35,"month":3,"nanos":0,"seconds":22,"time":1460032522000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0006","modifyDate":{"date":8,"day":5,"hours":12,"minutes":18,"month":3,"nanos":0,"seconds":35,"time":1460089115000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":35,"month":3,"nanos":0,"seconds":51,"time":1460032551000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0007","modifyDate":{"date":8,"day":5,"hours":10,"minutes":12,"month":3,"nanos":0,"seconds":35,"time":1460081555000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":36,"month":3,"nanos":0,"seconds":18,"time":1460032578000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0008","modifyDate":{"date":8,"day":5,"hours":10,"minutes":7,"month":3,"nanos":0,"seconds":45,"time":1460081265000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":36,"month":3,"nanos":0,"seconds":37,"time":1460032597000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0009","modifyDate":{"date":8,"day":5,"hours":10,"minutes":7,"month":3,"nanos":0,"seconds":43,"time":1460081263000,"timezoneOffset":-480,"year":116},"state":true,"statu":3},{"cash":50,"consumerId":"402881f353e4650e0153e544f6ce0004","consumers":[],"createDate":{"date":7,"day":4,"hours":20,"minutes":36,"month":3,"nanos":0,"seconds":55,"time":1460032615000,"timezoneOffset":-480,"year":116},"id":"402881f353f071b30153f0b6dfaf0010","modifyDate":{"date":9,"day":6,"hours":19,"minutes":1,"month":3,"nanos":0,"seconds":28,"time":1460199688000,"timezoneOffset":-480,"year":116},"state":true,"statu":3}],"pageCount":1,"pageIndex":1,"total":22}
取消 提交回答
全部回答(1)
  • 被纵养的懒猫
    2019-09-23 14:14:47

    var jsonstr = "未知...";var jsondata = eval('(' + jsonstr + ')');for (var p in jsondata) {    console.log(p + ": " + jsondata[p]);}

    答案来源于网络

    0 0
相关问答

1

回答

SQL解析复杂JSON问题

2021-12-06 12:28:26 592浏览量 回答数 1

1

回答

请教一个JAVA GUI程序制作EXE的问题,谢谢大家!

2020-01-07 21:31:18 764浏览量 回答数 1

1

回答

es6引用js,免登陆问题

2017-12-16 14:26:05 1846浏览量 回答数 1

0

回答

OSS如何投递到JSON存储?

2017-10-23 10:37:22 2458浏览量 回答数 0

1

回答

json解析格式问题。。。。。

2016-07-06 17:37:48 1703浏览量 回答数 1

1

回答

ios中的json解析问题

2016-07-01 16:14:20 1633浏览量 回答数 1

1

回答

如何把淘宝地址库写在js里? 不用json接口。做一个三联动selected

2016-06-03 15:58:05 2254浏览量 回答数 1

1

回答

json值获取问题

2016-05-30 09:49:46 1560浏览量 回答数 1

1

回答

IOS5嵌套的json解析问题

2016-03-26 10:36:13 1654浏览量 回答数 1

1

回答

使用extjs后,不能用nginx整合tomcat,什么原因?

2016-03-24 10:29:07 1925浏览量 回答数 1
+关注
杨冬芳
IT从业
1
文章
9167
问答
问答排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载