1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

Updated sorting architecture so the collections can specify the sort-oddities instead of in backgrid column definitions.

This commit is contained in:
Taloth Saldono
2014-07-04 22:07:03 +02:00
parent 2b6f908038
commit 6941888832
20 changed files with 173 additions and 186 deletions
+10 -4
View File
@@ -4,9 +4,10 @@ define(
'History/HistoryModel',
'backbone.pageable',
'Mixins/AsFilteredCollection',
'Mixins/AsSortedCollection',
'Mixins/AsPersistedStateCollection'
], function (HistoryModel, PageableCollection, AsFilteredCollection, AsPersistedStateCollection) {
var collection = PageableCollection.extend({
], function (HistoryModel, PageableCollection, AsFilteredCollection, AsSortedCollection, AsPersistedStateCollection) {
var Collection = PageableCollection.extend({
url : window.NzbDrone.ApiRoot + '/history',
model: HistoryModel,
@@ -35,6 +36,10 @@ define(
'failed' : ['eventType', '4']
},
sortMappings: {
'series' : { sortKey: 'series.sortTitle' }
},
initialize: function (options) {
delete this.queryParams.episodeId;
@@ -58,6 +63,7 @@ define(
}
});
collection = AsFilteredCollection.call(collection);
return AsPersistedStateCollection.call(collection);
Collection = AsFilteredCollection.call(Collection);
Collection = AsSortedCollection.call(Collection);
return AsPersistedStateCollection.call(Collection);
});