2018-07-18 02:55:09 -04:00
|
|
|
const Mn = require('backbone.marionette');
|
|
|
|
const ItemView = require('./item');
|
|
|
|
const template = require('./main.ejs');
|
2018-06-20 02:51:18 -04:00
|
|
|
|
|
|
|
const TableBody = Mn.CollectionView.extend({
|
|
|
|
tagName: 'tbody',
|
|
|
|
childView: ItemView
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = Mn.View.extend({
|
|
|
|
tagName: 'table',
|
2020-02-18 23:55:06 -05:00
|
|
|
className: 'table table-hover table-outline table-vcenter card-table',
|
2018-06-20 02:51:18 -04:00
|
|
|
template: template,
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
body: {
|
|
|
|
el: 'tbody',
|
|
|
|
replaceElement: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onRender: function () {
|
|
|
|
this.showChildView('body', new TableBody({
|
|
|
|
collection: this.collection
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
});
|