Include sort and filter in list view back link
This commit is contained in:
committed by
Sebastiaan Janssen
parent
3163b5f2fe
commit
30cf2fd4b2
@@ -62,11 +62,13 @@
|
||||
function init() {
|
||||
|
||||
var content = $scope.content;
|
||||
|
||||
if (content.id && content.isChildOfListView && content.trashed === false) {
|
||||
$scope.page.listViewPath = ($routeParams.page) ?
|
||||
"/content/content/edit/" + content.parentId + "?page=" + $routeParams.page :
|
||||
"/content/content/edit/" + content.parentId;
|
||||
$scope.page.listViewPath = "/content/content/edit/" + content.parentId
|
||||
+ "?list=" + $routeParams.list
|
||||
+ "&page=" + $routeParams.page
|
||||
+ "&filter=" + $routeParams.filter
|
||||
+ "&orderBy=" + $routeParams.orderBy
|
||||
+ "&orderDirection=" + $routeParams.orderDirection;
|
||||
}
|
||||
|
||||
// we need to check wether an app is present in the current data, if not we will present the default app.
|
||||
|
||||
@@ -44,7 +44,9 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
return selected.id;
|
||||
};
|
||||
createEditUrlCallback = function (item) {
|
||||
return "/" + $scope.entityType + "/" + $scope.entityType + "/edit/" + item.id + "?page=" + $scope.options.pageNumber;
|
||||
return "/" + $scope.entityType + "/" + $scope.entityType + "/edit/" + item.id
|
||||
+ "?list=" + $routeParams.id + "&page=" + $scope.options.pageNumber + "&filter=" + $scope.options.filter
|
||||
+ "&orderBy=" + $scope.options.orderBy + "&orderDirection=" + $scope.options.orderDirection;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -143,12 +145,13 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
|
||||
|
||||
}
|
||||
|
||||
var listParamsForCurrent = $routeParams.id == $routeParams.list;
|
||||
$scope.options = {
|
||||
pageSize: $scope.model.config.pageSize ? $scope.model.config.pageSize : 10,
|
||||
pageNumber: ($routeParams.page && Number($routeParams.page) != NaN && Number($routeParams.page) > 0) ? $routeParams.page : 1,
|
||||
filter: '',
|
||||
orderBy: ($scope.model.config.orderBy ? $scope.model.config.orderBy : 'VersionDate').trim(),
|
||||
orderDirection: $scope.model.config.orderDirection ? $scope.model.config.orderDirection.trim() : "desc",
|
||||
pageNumber: (listParamsForCurrent && $routeParams.page && Number($routeParams.page) != NaN && Number($routeParams.page) > 0) ? $routeParams.page : 1,
|
||||
filter: (listParamsForCurrent && $routeParams.filter ? $routeParams.filter : '').trim(),
|
||||
orderBy: (listParamsForCurrent && $routeParams.orderBy ? $routeParams.orderBy : $scope.model.config.orderBy ? $scope.model.config.orderBy : 'VersionDate').trim(),
|
||||
orderDirection: (listParamsForCurrent && $routeParams.orderDirection ? $routeParams.orderDirection : $scope.model.config.orderDirection ? $scope.model.config.orderDirection : "desc").trim(),
|
||||
orderBySystemField: true,
|
||||
includeProperties: $scope.model.config.includeProperties ? $scope.model.config.includeProperties : [
|
||||
{ alias: 'updateDate', header: 'Last edited', isSystem: 1 },
|
||||
|
||||
Reference in New Issue
Block a user