Results 1 to 4 of 4

Thread: Does DataView have outterTpl like itemTpl to wrap records?

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Toronto
    Posts
    105
    Vote Rating
    2
      0  

    Default Answered: Does DataView have outterTpl like itemTpl to wrap records?

    I am trying to wrap my DataView records, but cannot achieve this. This is what I am trying:

    Code:
    {
                xtype: 'dataview',
                store: 'Contacts',
                itemTpl: [
                            '<div class="list-holder">',
                                '<ul>',
                                    '<tpl for=".">',
                                        '<li>',
                                            '<a href="#"><img src="{ImageURL}" alt="{FirstName} {LastName}"></a>',
                                            '<p>{ShortBio}</p></div>',
                                        '</li>',
                                    '</tpl>',
                                '</ul>',
                            '</div>'
                        ]
    }
    The above gets rendered for every record. I thought <tpl for...> was where the loop started. Is it possible to pass an outter wrapper for my DataView items?

  2. Just use the tpl option, itemTpl is only there if you only want to specify the inner part.

    There's an example in the docs.

  3. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,431
    Answers
    650
    Vote Rating
    858
      0  

    Default

    Just use the tpl option, itemTpl is only there if you only want to specify the inner part.

    There's an example in the docs.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #3
    Sencha User
    Join Date
    Apr 2012
    Location
    shanghai,china
    Posts
    28
    Vote Rating
    0
      0  

    Default

    i use the tpl option,but the dataview still show the itemTpl. and where the example you said is. thank you

  5. #4
    Sencha User
    Join Date
    Apr 2012
    Location
    shanghai,china
    Posts
    28
    Vote Rating
    0
      0  

    Default

    do you solve the question? and if you do ,can you share the answer

Posting Permissions

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