backbone.js - Appending another view within a region - marionette -
i using backbone layoutmanager managing views within app. wanted try marionette. came across issue couldn't append view region.
html
<body> <div id="content"> <header id="header"></header> <div id="wrapper"> <span>some view content</span> </div> <footer id="footer"></footer> </div> </body>
app.js
myapp = new backbone.marionette.application(); var rm = new marionette.regionmanager(); var regions = rm.addregions({ mainregion : '#content', headerregion : '#header', wrapperregion : '#wrapper', footerregion : '#footer' }); regions.headerregion.show(new headerview()); regions.wrapperregion.show(new someview()); regions.footerregion.show(new footerview());
if want append view in wrapperregion how can ?
i wanted know there way insert view existing view? layout manager allowed me write below mentioned code.. how can achieve in marionette ?
var myview = backbone.view.extend({ tagname: "div", beforerender: function() { this.insertview(new itemview()); } });
one view per region. define region put other view in.
Comments
Post a Comment