Trouble Inserting To Dom Child Views In Backbone.js
Trying to get my child views (OfferMarketView) created from the forEach back into the DOM. What is the best way to do this? I can't get the below working. // DEFINE VIEW var OfferV
Solution 1:
You have to render you view before appending the element:
$("#offerCol").append(view.render().el);
Note that you have to to add return this;
in the render method so it is chainable:
varOfferMarketView = Backbone.View.extend({
tagName: "div",
className: "classname",
events: {},
render: function() {
returnthis;
}
});
Post a Comment for "Trouble Inserting To Dom Child Views In Backbone.js"