From 4ea0c4b514eed8d65849647955bfffa97559194a Mon Sep 17 00:00:00 2001 From: Anjali walsatwar Date: Fri, 17 Aug 2018 11:03:43 +0530 Subject: Add sorting capability to property assignment Change-Id: I74cbebac6cfe76f4334fcb46813c98686de55822 Issue-ID: SDC-1516 Signed-off-by: Anjali walsatwar --- .../logic/properties-table/properties-table.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'catalog-ui/src/app/ng2/components/logic/properties-table/properties-table.component.ts') 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 = new EventEmitter(); @Output() updateCheckedPropertyCount: EventEmitter = new EventEmitter();//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 ){ } -- cgit 1.2.3-korg