Reputation: 103
I am new to marionette and I wanted to create a dynamic grid-like structure with two columns and multiple rows. I am really stuck on how to create exactly two columns, and have a grid-like structure. Thanks in advance
Upvotes: 0
Views: 673
Reputation: 7169
The better way - use CompositeView
// A Grid Row
var GridRow = Backbone.Marionette.ItemView.extend({
template: "#row-template",
tagName: "tr"
});
// The grid view
var GridView = Backbone.Marionette.CompositeView.extend({
tagName: "table",
template: "#grid-template",
itemView: GridRow,
});
Look this example http://jsfiddle.net/derickbailey/me4NK/
Upvotes: 1