Desired output :
<script id="table-template" type="text/html">
<table>
<thead>
ADD THE HEADER NAMES HERE DYNAMICALLY,
</thead>
<!-- insert collection items -->
<tbody></tbody>
</table>
</script>
I am trying to get the above template generated, the problem here is the header names
Portfolio Amount Exchange Amount in Fccy Quantity Account
like the above it would be the fixed one, the user can give any number of header names.
This is the Code i have done :
Grid.Hexgrid = Backbone.Marionette.CompositeView.extend({
template: "#header",
initialize : function (options){
this.header = options.header;
},
onRender : function(){
ADD THE HEADER INFORMATION HERE WHICH WILL COME UNDER <THEAD></THEAD>
},
appendHtml: function(collectionView, itemView, index){
collectionView.$("tbody").append(itemView.el);
}
});
I have given my comments in BOLD
letter. would somebody help me to complete this Please.