Poorna Chand
Poorna Chand

Reputation: 103

how to make a dynamic grid view using marionette.js

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

Answers (1)

Vasiliy vvscode Vanchuk
Vasiliy vvscode Vanchuk

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

Related Questions