View Full Version : Including tags before and after the tags generated by itemTpl in a data view

19 Jan 2012, 8:24 AM
I am using a data view to display data from a store. I'm wondering how I might include html tags before and after all of the tags generated by the itemTpl. For example, I may want each item to be formatted as a table cell, like "<td>{myField}</td>". But before the itemTpl, I would need "<table><tbody><tr>", and after the itemTpl, I would need "</tr></tbody></table>". In addition, I might want to create a new table row after every three items, so would need to be able to include a conditional for that. I've looked into using just the tpl field instead of itemTpl, but couldn't get that to work. I also saw renderTpl, but not sure how to use it. Any help is appreciated.

19 Jan 2012, 11:06 AM
Each item is aa element so they are separate. itemTpl will only be able to be used within each row.