diff options
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 ){ } |