mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACA-3672] - added server order for document -list (#5899)
* [ACA-3672] - added sorting server side for document-list * [ACA-3672] - added and fixed unit tests for backend order * [ACA-3672] - fixed failing test * [ACA-3672] - regenerated doc and renamed variable Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local>
This commit is contained in:
@@ -191,7 +191,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
* before delivering it.
|
||||
*/
|
||||
@Input()
|
||||
sortingMode = 'client';
|
||||
sortingMode = 'server';
|
||||
|
||||
/** The inline style to apply to every row. See
|
||||
* the Angular NgStyle
|
||||
@@ -314,6 +314,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
selection = new Array<NodeEntry>();
|
||||
$folderNode: Subject<Node> = new Subject<Node>();
|
||||
allowFiltering: boolean = true;
|
||||
orderBy: string[] = ['name ASC'];
|
||||
|
||||
// @deprecated 3.0.0
|
||||
folderNode: Node;
|
||||
@@ -639,7 +640,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
this.updateCustomSourceData(this._currentFolderId);
|
||||
}
|
||||
|
||||
this.documentListService.loadFolderByNodeId(this._currentFolderId, this._pagination, this.includeFields, this.where)
|
||||
this.documentListService.loadFolderByNodeId(this._currentFolderId, this._pagination, this.includeFields, this.where, this.orderBy)
|
||||
.subscribe((documentNode: DocumentLoaderNode) => {
|
||||
if (documentNode.currentNode) {
|
||||
this.folderNode = documentNode.currentNode.entry;
|
||||
@@ -665,6 +666,11 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
}
|
||||
|
||||
onSortingChanged(event: CustomEvent) {
|
||||
this.orderBy = [''.concat(event.detail.key, ' ' , event.detail.direction)];
|
||||
this.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a set of predefined columns.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user