2013-12-11 78 views
0

我有附加到APP的区域。嵌入布局访问子区域

iApp.addRegions({ 
    sregion : "#sregion" 

});

该区域被附接到布局基本上是应用程序的布局,其具有inturn区域

var iLayout = Marioneete.Layout.extend({ 
    template : LayoutTemplate, 
    regions : { 
     mainheader : "#mainheader", 
     menu : "#mainmenu", 
     content : "#mcontent" 
    } 

最后区域(内容)被再次布局

template : MainContentLayout, 
    regions : { 
     contentmainheader : "#headmain", 
     cotenttable : "#tablecontainer", 
     cotentdetailer : "#issuedetailer" 
    } 
}); 

我在控制器通过存储this.applayout主页面事件,以便我可以访问其他事件发生时的视图,如下所示。

   var MyApp = require('mapp'); 
       mlayout = new AppLayout(); 
       MyApp.sregion.show(mlayout); 
       this.applayout = mlayout; 

在所选择项同一个控制器点击我试图访问其他“内容详图”,如下这是行不通的。

   this.applayout.content.cotentdetailer.show(new SelectedIssue({id:options})); 

我们如何真正从主区域/布局访问嵌套视图?我没有看到这方面的任何方法?

回答

0

您需要创建每个布局,并把它们在正确的区域第一:

//same as above, but I used correct parent layout 
var MyApp = require('mapp'); 
this.ilayout = new iLayout(); 
MyApp.sregion.show(this.ilayout); 

//You didnt include all your source code for this layout so I am guessing on the variable name. 
this.mLayout = new mLayout(); 
this.ilayout.content.show(this.mLayout) 

//now you can access contentdetailer 
this.mLayout.contentdetailer.show(new SelectedIssue({id:options})) 
0

的问题已基本访问是在另一个区域布局的区域。做了一些研究,发现需要访问currenView然后区域。我正在朝这个方向思考。无论如何,它是像下面解决。

this.applayout.content.currentView.cotentdetailer.show(new SelectedIssue({id:id}));