diff options
author | 2018-08-17 11:03:43 +0530 | |
---|---|---|
committer | 2018-09-12 11:53:10 +0000 | |
commit | 4ea0c4b514eed8d65849647955bfffa97559194a (patch) | |
tree | 9df9c14fb28f672eda4b0b805179fd5269ec4d64 /catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts | |
parent | c72587ed4cdd2a324ef6e5a1576f9a132ef314a1 (diff) |
Add sorting capability to property assignment
Change-Id: I74cbebac6cfe76f4334fcb46813c98686de55822
Issue-ID: SDC-1516
Signed-off-by: Anjali walsatwar <anjali.walsatwar@huawei.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts b/catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts index da1fb82ba0..b11bc02fb9 100644 --- a/catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts @@ -3,6 +3,7 @@ * SDC * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2017 Huawei Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +45,18 @@ export class PropertiesTableComponent { @Output() selectPropertyRow: EventEmitter<PropertyRowSelectedEvent> = new EventEmitter<PropertyRowSelectedEvent>(); @Output() updateCheckedPropertyCount: EventEmitter<boolean> = new EventEmitter<boolean>();//only for hasDeclareOption + sortBy: String; + reverse: boolean; + direction: number; + path:string[]; + + sort(sortBy){ + this.reverse = (this.sortBy === sortBy) ? !this.reverse : true; + this.direction = this.reverse ? 1 : -1; + this.sortBy = sortBy; + this.path = sortBy.split('.'); + } + constructor (private propertiesService:PropertiesService ){ } |