PDA

View Full Version : Does DataView have outterTpl like itemTpl to wrap records?



basememara
4 Feb 2012, 3:05 PM
I am trying to wrap my DataView records, but cannot achieve this. This is what I am trying:



{
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?

evant
4 Feb 2012, 3:31 PM
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.

xiuping
15 May 2012, 5:51 PM
i use the tpl option,but the dataview still show the itemTpl. and where the example you said is. thank you:)

xiuping
15 May 2012, 5:52 PM
do you solve the question? and if you do ,can you share the answer