Skip to content

How to invoke region from layoutview #1

@Prasadu112

Description

@Prasadu112

""""""""""drive.js""""""""""""""""

var MenuView=Backbone.View.extend({

render:function(){
this.$el.html("this is menu part");
return this;
}
});
var ContentView=Backbone.View.extend({

render:function(){
   this.$el.html("This is content view");
    return this;
}

});
var AppLaoutView=Marionette.LayoutView.extend({
template:$("#inputtemplate"),
render:function(){
this.$el.html("this is layout view");
},
regions:{
menu:"#menu",
content:"#content"
}
});
var applayout=new AppLaoutView({el:"#inputcontent"});
applayout.render();

applayout.getRegion('menu').show(new MenuView());
applayout.getRegion('content').show(new ContentView());

//////////////////////////////////////////////////////////////////////////////
""""""""input.html"""""""""""""

image

//////////////////////////////////////////////////////////////////////

""""""""""""""""" error"""""""""""""""""""""""""""

backbone.marionette.min.js:21 Uncaught constructor {name: "Error", message: "An "el" #menu must exist in DOM", stack: "Error: An "el" #menu must exist in DOM↵ at cons… at file:///C:/nodehttp/final/js/driver.js:127:29"}message: "An "el" #menu must exist in DOM"name: "Error"stack: "Error: An "el" #menu must exist in DOM↵ at constructor._ensureElement (file:///C:/nodehttp/Bookstore/Source%20Code/js/Libraries/backbone.marionette.min.js:21:13472)↵ at constructor.show (file:///C:/nodehttp/Bookstore/Source%20Code/js/Libraries/backbone.marionette.min.js:21:11800)↵ at file:///C:/nodehttp/final/js/driver.js:127:29"proto: Error
_ensureElement @ backbone.marionette.min.js:21
show @ backbone.marionette.min.js:21
(anonymous) @ driver.js:127

////////////////////////////////

can anyone solve with this code how to invoke a region

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions