javascript - How do I pass a view to another Backbone view? -
i trying create base table class in backbone. each subclass row have different look. want pass in view of row. trying add attribute set in child class, keep getting , error typeerror: cannot read property '_listenerid' of undefined
. here parent class:
var basetableview = baseview.extend({ template: null, rowview: null, initialize: function() { ... } });
here child class set row view up:
var peoplecollectionview = basetableview.extend({ initialize: function() { this.collection = new peoplecollection(); this.template = peopletemplate; this.itemview = personview; basetableview.prototype.initialize.apply(this, arguments); } });
when go use personview in super class, use this:
var view = new this.rowview({ model: item });
that when above stated error typeerror: cannot read property '_listenerid' of undefined
. how can fix this, or if should set hierarchy different, how should done? help.
Comments
Post a Comment