Results 1 to 2 of 2

Thread: Can you assign a variable in XTemplate?

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default Can you assign a variable in XTemplate?

    So I want to create a format like this in my XTemplate:
    Football
    * 49ers
    * Saints
    BaseBall
    * Giants
    * Mets
    * Cardinals

    My data structure is
    [
    {
    type:'Football',
    name:'49ers'
    },
    {
    type:'Football',
    name:'Saints'
    },
    {
    type:'BaseBall',
    name:'Giants'
    }
    ]

    One way to create the format above is to set a variable in XTemplate and check to see if it's changed so the header (Football, Baseball) changed.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,029
    Answers
    3976
    Vote Rating
    1368
      0  

    Default

    In the <tpl> you could do something like this.type = values.type, this will be the scope of the template.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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