现在我有一个返回的集合数据,例如:
[{'category':1,
'title':"Current Company",
'people':{"count":2,
"keyword":"",
"executiveInfos":[{"name":"Darren Suomi",
"title":"Global Vice President of Sales",
"companyId":2867257,
"employmentId":10993552,
"executiveId":10152454,
"imageUrl":"https://d1tzls7byl3ryp.cloudfront.net/iv/profileImages/executiveImage/321446",
"count":0,
"executiveConnectionImageUrls":[],
"trackedByWatchlists":[],
"employmentType":0},
{"name":"Gregory Gunn",
"title":"Vice President of Business Development",
"companyId":2867257,
"employmentId":9240823,
"executiveId":9049103,
"imageUrl":"https://d1tzls7byl3ryp.cloudfront.net/iv/profileImages/executiveImage/292479",
"count":0,
"executiveConnectionImageUrls":[],
"trackedByWatchlists":[],
"employmentType":0}]***}
},
{'category': 2,
'title':"Former Company",
'people':{"count":0,
"finance":0,
"otherFunction":0,
"keyword":"",
"executiveInfos":[]}
},
{'category': 4,
'title':"Family Tree Company",
'people':{"count":0,
"keyword":"",
"executiveInfos":[]}
}
]
在数据中,它有3个类别,在每个类别中都有一个名为people的属性,现在我想列出每个类别中人的executiveInfos,我的listview是:
var PeopleListView = Backbone.View.extend({
el: $('.bucketContent'),
initialize: function(){
this.listenTo(this.collection, 'reset', this.render);
}
render: function() {
this.collection.each( function( $model) {
var itemview = new PeopleItemView({model : $model});
this.$el.prepend(itemview.render().el);
}, this);
return this;
}
});
我应该怎么办?谢谢你。