lundi 3 octobre 2016

Marionette Accessing or setting nth level child property

I have following structure for a Marionette application, basically parent view calling child views. I need to set template from parent level to say 4 level below child.

Basically I am doing like below

            var commonCaseMultiTabsViewObj = CommonCaseMultiTabsView;

            //template for caseSubDetailsView
            commonCaseMultiTabsViewObj.prototype.commonCaseDetailsView.prototype.baseCaseDetailsView.prototype.caseSubDetailsView.prototype.template = CaseSubDetailsTemplate;


            self.casesTabRightDetailsRegion.show(new commonCaseMultiTabsViewObj({
                parent : self,
                getAllCases : self.options.getAllCases,
                loggedInUserInfo : self.options.loggedInUserInfo,
                moduleEvent : self.options.vent,                    
                //caseSubDetailsTplRef : CaseSubDetailsTemplate, 
                moduleData : self.options.inputObj,
            }));

Is calling prototype of child views and chaining them a good idea? I don't want to manage sending template-reference as parameters. What's the best practice for this ?

Aucun commentaire:

Enregistrer un commentaire