marionette - Cannot get subview to be inserted into layout -
i creating webapp using marionette.backbone , got module creates layout , add 3 subviews it.
the layout rendered fine regions not filled each sub view. missing. no error in console.
this controller:
@appic.module "projectsapp.add", (add, app, backbone, marionette, $, _) -> add.controller = addproject: -> @layout = @getlayoutview() @layout.on "show", => @showleft @showcontent @showright app.mainregion.show @layout showleft: -> leftview = @getleftview @layout.leftregion.show leftview showcontent: -> contentview = @getcontentview @layout.contentregion.show contentview showright: -> rightview = @getrightview @layout.rightregion.show rightview getleftview: -> new add.left getcontentview: -> new add.form getrightview: -> new add.right getlayoutview: -> new add.layout
this view part of module
@appic.module "projectsapp.add", (add, app, backbone, marionette, $, _) -> class add.layout extends app.views.layout template: "projects/add/templates/add_layout" regions: leftregion: "#left-region" contentregion: "#content-region" rightregion: "#right-region" class add.left extends app.views.itemview template: "projects/add/templates/_left" class add.right extends app.views.itemview template: "projects/add/templates/_right" class add.form extends app.views.itemview template: "projects/add/templates/_form"
you assigning pointer function rather functions result in show methods. try:
showleft: -> leftview = @getleftview() @layout.leftregion.show leftview showcontent: -> contentview = @getcontentview() @layout.contentregion.show contentview showright: -> rightview = @getrightview() @layout.rightregion.show rightview
Comments
Post a Comment