我有一个骨干木偶复合视图如下
VideosView = Backbone.Marionette.CompositeView.extend({
template : videosTpl,
id : "video",
itemView : VideoView,
initialize : function() {
//fetching the collection
var myVideos = new VideoCollection();
myVideos.fetch();
this.collection = myVideos;
},
appendHtml : function(collectionView, itemView) {
//appending each videos to the video list
console.log("appendHtml");
collectionView.$("ul").append(itemView.el);
},
onRender: function(){
console.log("onRender");
},
onShow: function(){
console.log("onShow");
}
});
控制台中的输出是
- 渲染
- 展出
- 4 附加HTML
- 渲染
根据骨干木偶的预期代码流是
- 4 附加HTML
- 渲染
- 展出
这是怎么发生的?