Results 1 to 4 of 4

Thread: Sencha Architect XTemplate scope

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Dec 2010
    Vote Rating

    Default Answered: Sencha Architect XTemplate scope

    I'm trying to set a scope variable on the itemTpl in an Ext.dataview.List in architect 3.0 Does anyone know how to do this? I can add a scope property on the itemTpl but it seems to convert 'this' to a string.thanksFrancesco

  2. Hi Jason,thanks for the pointer :-) I like using the itemTpl editor in Sencha Architect as it makes it easy to spot mistakes and add template functions. So I kept my template in the lists itemTpl property and added the following on the lists initialize method://re-create template so it compiles to include scopevar itemTpl = this.getItemTpl();itemTpl.scope = this;this.setItemTpl(Ext.create('Ext.XTemplate',itemTpl.html, itemTpl));Now my template functions have access to the required scope via this.scope and I still get to use Architects XTemplate editor.Thanks againFrancesco

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts