Here is the code compositeView snippet using which i'm creating tree structure.
var TreeView = Backbone.Marionette.CompositeView.extend({
template: "#filterTemplate",
className:"menuItem",
tagName: "ul",
initialize: function(){
this.collection = this.model.type;
counter=0;
},
events: {
'click .menuItem': 'show'
},
show: function(event) {
var target = $(event.target);
console.log(target);
},
appendHtml: function(collectionView, itemView){
// ensure we nest the child list inside of
// the current list item
$(itemView.el).attr("id","innerMenu"+counter);
$(itemView.el).attr("class","innerMenu");
collectionView.$("li:first").append(itemView.el);
counter++;
}
});
Tree is rendered perfect but events are not getting bind or not fired. Show method is never called. i'm using Backbone.Marionette v0.9.1