【发布时间】:2015-08-16 16:07:48
【问题描述】:
我的 JSON 存储(django rest 框架)返回“count”、“next”、“previous”和“results”的键。
“count”是可用的行数。
“next”是下一页结果的 url(例如 ids 26-50)。
“previous”是上一页结果的 url(在这种情况下为 null,因为这是结果的第一页)。
“结果”键包含我想在 OnDemandGrid 中显示的实际数据对象。
如何将“结果”关键数据集合连接到网格?提前感谢您的帮助。
返回的 JSON ( collection: new Rest({target: '/api/events'?format=json'),}) 如下所示:
{
"count":1411,
"next":"http://localhost/api/events/?format=json&page=2",
"previous":null,
"results": [
{"id":1,"event_type":"02","event_at":"2015-03-31T12:53:41Z","machine_id":1,"revs":4342,"color":5,"heads_info":"using http","tag":1,"hidden":false},
{"id":2,"event_type":"02","event_at":"2015-03-31T12:53:41Z","machine_id":1,"revs":4342,"color":5,"heads_info":"using http","tag":1,"hidden":false},
...
{"id":25,"event_type":"02","event_at":"2015-03-31T12:54:01Z","machine_id":1,"revs":4342,"color":5,"heads_info":"using http","tag":1,"hidden":false},
]
}
【问题讨论】:
标签: json django rest dojo dgrid