javascript - How can I add a <thead> section to a marionette collectionview with tagName: 'table'? -
i have collection view looks this:
var personview = marionette.itemview.extend({ tagname: 'tr', template: function (model) { return _.template("<td><%= data.firstname %></td><td><%= data.lastname %></td>", { firstname: model.firstname, lastname: model.lastname }, { variable: 'data' }); } }), personcollectionview = marionette.collectionview.extend({ tagname: 'table', itemview: personview });
it works fine, can't figure out best way add <thead>
section table. thought of changing tagname: 'table'
tagname: 'tbody'
, adding thead
section in layout displays collection view, doesn't clean approach. indeed, if use collection view elsewhere, have reproduce thead
section in layout... proposed way of doing this?
p.s see https://github.com/shawninder/table-collection-views working example. you'll notice table has no <thead>
section, i'm trying solve.
update: fixed this commit based on accepted answer
you may need use compositeview instead. compositeview
can provide template adds thead
, use itemviewcontainer
render collections. read doc , sure figure out solution.
Comments
Post a Comment