marionette CompositeView access from templatehelpers -


mymodule.compositeview = marionette.compositeview.extend({     tagname: "div",     classname: 'liste',     id: idview,     itemview: monmodule.itemview,     itemviewcontainer: "ul",     title: 'my title',     template: _.template('<%= header() %><ul></ul>'),     templatehelpers: {          header: function() {             var entete = _.template(collectionheader, {nom: title});             return entete;         }      }  

hello,

i don't manage 'title' in templatehelpers/header composite view definition. 'this' gives me access templatehelpers while itemview can access items.

is possible data in templatehelper or give them in case ?

thankyou

sure. can access this assigning function templateshelpers, rather object.

e.g:

templatehelpers: function() {   var = this;    return {     header: function() {       // code goes here       // refers view object     }   } } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -