wakeup
28 Jun 2010, 3:33 AM
Hey guys,
Is there a way to not just include json field-variables in templates but also arbitrary JS?
Example: {var t = Date.parse(t_start); t.hours + ":" + t.minutes;} instead of {t_start} in:
tpl: [
'<tpl for=".">',
'<div class="track_list">',
'<div class="track_start">{t_start}</div>',
'<div class="track_performer">{performer}</div>',
'-',
'<div class="track_title">{name}</div>',
'</div>',
'</tpl>'
]
cheers,
max
Is there a way to not just include json field-variables in templates but also arbitrary JS?
Example: {var t = Date.parse(t_start); t.hours + ":" + t.minutes;} instead of {t_start} in:
tpl: [
'<tpl for=".">',
'<div class="track_list">',
'<div class="track_start">{t_start}</div>',
'<div class="track_performer">{performer}</div>',
'-',
'<div class="track_title">{name}</div>',
'</div>',
'</tpl>'
]
cheers,
max