I am using jtemplates with jquery and getting an error when I try to use tables in the template.
Following is working
<ul>
{#foreach $T as record}
<li>{$T.record.FirstName}</li>
{#/for}
</ul>
but the following does not work and gives error $T.record is undefined in firebug
<table border="1">
{#foreach $T as record}
<tr>
<td>{$T.record.FirstName}</td>
</tr>
{#/for}
</table>
Following is how I am calling template with some data
$(document).ready(function() {
var data = [
{ ID: 1, FirstName: 'Anne', Email: '[email protected]' },
{ ID: 2, FirstName: 'Amelie', Email: '[email protected]' },
{ ID: 3, FirstName: 'Polly', Email: '[email protected]' },
{ ID: 4, FirstName: 'Alice', Email: '[email protected]' },
{ ID: 5, FirstName: 'Martha', Email: '[email protected]' }
];
$("#jTemplateDemo").setTemplate($("#templateHolder").html());
$("#jTemplateDemo").processTemplate(data);
});
Any help in resolving this is greatly appreciated.