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 User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,984
    Answers
    725
    Vote Rating
    933
      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.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  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
  •