Sencha touch 2 Sencha touch 2,使用xtemplate打印嵌套JSON数组

Sencha touch 2 Sencha touch 2,使用xtemplate打印嵌套JSON数组,sencha-touch-2,Sencha Touch 2,我正在开发一个简单的电影列表应用程序。 我用的是烂番茄。以下是json: movies": [{ "id": "771310572", "title": "Cloud Atlas", "year": 2012, "mpaa_rating": "R", "runtime": 163, "release_dat

我正在开发一个简单的电影列表应用程序。 我用的是烂番茄。以下是json:

movies": [{ "id": "771310572", "title": "Cloud Atlas", "year": 2012, "mpaa_rating": "R", "runtime": 163, "release_dates": { "theater": "2012-10-26" }, "ratings": { "critics_rating": "Fresh", "critics_score": 80, "audience_score": 98 }, "synopsis": "Cloud Atlas explores how the actions and consequences of individual lives impact one another throughout the past, the present and the future. Action, mystery and romance weave dramatically through the story as one soul is shaped from a killer into a hero and a single act of kindness ripples across centuries to inspire a revolution in the distant future. Each member of the ensemble appears in multiple roles as the stories move through time. -- (C) Warner Bros.", "posters": { "thumbnail": "http://content6.flixster.com/movie/11/16/71/11167192_mob.jpg", "profile": "http://content6.flixster.com/movie/11/16/71/11167192_pro.jpg", "detailed": "http://content6.flixster.com/movie/11/16/71/11167192_det.jpg", "original": "http://content6.flixster.com/movie/11/16/71/11167192_ori.jpg" }, "abridged_cast": [{ "name": "Tom Hanks", "id": "162655641", "characters": ["Dermot 'Duster' Hoggins", "Dr. Henry Goose", "Isaac Sachs", "Valleysman Zachry"] }, { "name": "Halle Berry", "id": "162652386", "characters": ["Jocasta Ayrs", "Luisa Rey", "Meronym"] }, { "name": "Jim Broadbent", "id": "162653369", "characters": ["Vyvyan Ayrs"] }, { "name": "Hugo Weaving", "id": "162709905", "characters": ["Bill Smoke", "Nurse Noakes", "Old Georgie"] }, { "name": "Jim Sturgess", "id": "563717190", "characters": ["Adam Ewing", "Hae-Joo Im"] }] 电影“:[{ “id”:“771310572”, “标题”:“云图”, “年份”:2012年, “mpaa_评级”:“R”, “运行时”:163, “发布日期”:{ “剧院”:“2012-10-26” }, “评级”:{ “评论家”评级:“新鲜”, “评论家评分”:80分, “观众评分”:98分 }, “大纲”:Cloud Atlas探索了个人生活的行为和后果在过去、现在和未来是如何相互影响的。行动、神秘和浪漫戏剧性地交织在故事中,一个灵魂从一个杀手变成了一个英雄,一个善良的行为在几个世纪间荡漾,激发了遥远世界的革命未来。随着故事随着时间的推移,剧团的每个成员都会扮演多个角色, “海报”:{ “缩略图”:http://content6.flixster.com/movie/11/16/71/11167192_mob.jpg", “配置文件”:http://content6.flixster.com/movie/11/16/71/11167192_pro.jpg", “详细”:http://content6.flixster.com/movie/11/16/71/11167192_det.jpg", “原件”:http://content6.flixster.com/movie/11/16/71/11167192_ori.jpg" }, “节选演员阵容”:[{ “姓名”:“汤姆·汉克斯”, “id”:“162655641”, “人物”:[“德莫特·达斯特·霍金斯”、“亨利·戈斯博士”、“艾萨克·萨克斯”、“瓦莱斯曼·扎克里”] }, { “姓名”:“哈莉·贝瑞”, “id”:“162652386”, “人物”:[“乔卡斯塔·艾尔斯”、“路易莎·雷伊”、“梅罗尼姆”] }, { “姓名”:“吉姆·布罗德本特”, “id”:“162653369”, “字符”:[“Vyvyan Ayrs”] }, { “名称”:“雨果编织”, “id”:“162709905”, “人物”:[“比尔·斯莫克”、“诺克斯护士”、“老乔治”] }, { “姓名”:“吉姆·斯特吉斯”, “id”:“563717190”, “人物”:[“亚当·尤因”、“海珠·伊姆”] }] 我能够获得显示电影列表的第一个列表视图和电影列表项上的ontap,我能够加载下一个视图以显示电影详细信息

我一直在xtemplate中显示abridged_cast。如果我使用{abridged_cast},页面会显示object,object

我找不到任何将从此数组中提取值并显示的函数。 如何在模板中显示数组内容


谢谢。

可能重复:谢谢,它可以工作。我以前尝试过这个,但当时不适合我。因为我不理解在模板{u associated\u model}中显示关联记录的概念。哎呀!对我来说,只显示第一个数组项:(.URL中发布的示例也有同样的问题。@timbaktoo您可能想更新您的问题,并详细解释什么不起作用。否则,这基本上是重复的(即使经过编辑也很可能是重复的)。我让它起作用了。我在模板中使用了循环
  • {name}
    字符:[{Characters}]