You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/UI/Missing/MissingLayout.js

75 lines
2.4 KiB

'use strict';
define(
[
'marionette',
'backgrid',
'Missing/Collection',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/AirDateCell',
'Shared/Grid/Pager',
'Shared/LoadingView'
], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, AirDateCell, GridPager, LoadingView) {
return Marionette.Layout.extend({
template: 'Missing/MissingLayoutTemplate',
regions: {
missing: '#x-missing',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns:
[
{
name : 'series',
label : 'Series Title',
sortable: false,
12 years ago
cell : SeriesTitleCell
},
{
name : 'this',
label : 'Episode',
sortable: false,
12 years ago
cell : EpisodeNumberCell
},
{
name : 'this',
label : 'Episode Title',
sortable: false,
12 years ago
cell : EpisodeTitleCell
},
{
name : 'airDate',
label: 'Air Date',
cell : AirDateCell
}
],
_showTable: function () {
this.missing.show(new Backgrid.Grid({
columns : this.columns,
collection: this.missingCollection,
className : 'table table-hover'
}));
this.pager.show(new GridPager({
columns : this.columns,
collection: this.missingCollection
}));
},
onShow: function () {
var self = this;
12 years ago
this.missing.show(new LoadingView());
12 years ago
this.missingCollection = new MissingCollection();
this.missingCollection.fetch().done(function () {
self._showTable();
});
}
});
});