All lists (included related lists) now send the order_by parameter to the API. Use the key: true attribute in the list definition to specify the default sorting field.

This commit is contained in:
Chris Houseknecht
2013-05-06 17:59:13 -04:00
parent d2dad90eb8
commit ccb732bd69
3 changed files with 27 additions and 9 deletions

View File

@@ -23,13 +23,16 @@ angular.module('RefreshRelatedHelper', ['RestServices', 'Utilities'])
var iterator = params.iterator;
var url = params.url;
url.replace(/page_size\=\d+/,''); //stop repeatedly appending page_size
Rest.setUrl(url);
Rest.get()
Rest.get({ params: { page_size: scope[iterator + 'PageSize'] }})
.success( function(data, status, headers, config) {
scope[set] = data['results'];
scope[iterator + 'NextUrl'] = data.next;
scope[iterator + 'PrevUrl'] = data.previous;
scope[iterator + 'Count'] = data.count;
scope[iterator + 'PageCount'] = Math.ceil((data.count / scope[iterator + 'PageSize']));
scope[iterator + 'SearchSpin'] = false;
})
.error ( function(data, status, headers, config) {