PDA

View Full Version : Set Card from a template



danvega
26 Jul 2010, 6:35 AM
Trying to figure out how to do this. I have a template and it has a loop inside it for every topic the speaker is going to present. I want the topic name to link to the next card that will show the details.



var dtpl = [
'<tpl for=".">',
'<div class="session-detail">',
'<span class="strong">{name}</span><br/>',
'{bio}<br/><br/>',
'<span class="strong">Topics</span><br/>',
'<tpl for="topics">',
'<a href="">{name}</a><br/>',
'</tpl>',
'</div>',
'</tpl>'
];



If this is not possible I could probably just create a list and add the data to that list, from there I know what to do.

evant
26 Jul 2010, 4:20 PM
Setup some kind of event delegation, as an example:



<div id="foo">
<a href="1">Foo1</a>
<a href="2">Foo2</a>
<a>Foo3</a>
<a>Foo4</a>
</div>




Ext.get('foo').on('click', function(e, t){
e.stopEvent();
console.log(t.href);
}, null, {delegate: 'a'});