From 2b783041f85d9b0a29f2b6983c1466b2f7057914 Mon Sep 17 00:00:00 2001 From: Sudarshan Kumar Date: Thu, 30 Jul 2020 17:12:48 +0530 Subject: [PATCH] Edit Functional Menu is not working Edit Functional Menu is not working-[PORTAL-973] Issue-ID: PORTAL-973 Change-Id: I27edcf7fbd0524e234e6cca8ab400784937b1d73 Signed-off-by: Sudarshan Kumar --- .../functional-menu/functional-menu.component.html | 4 +- .../functional-menu/functional-menu.component.ts | 73 +++++++++++----------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html index d898563b..54df2d12 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html @@ -40,7 +40,7 @@

Edit Functional Menu

-
+
diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts index d3b5a164..c231061d 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts @@ -151,43 +151,42 @@ export class FunctionalMenuComponent implements OnInit { * @param ngbModal */ buildTree(treedataarray,ngbModal: NgbModal , _self){ - //console.log("treedataarray>>>>",treedataarray); - // $(function() { - // $('#jqTree').tree('loadData', treedataarray); - // $('#jqTree').tree({ - // data: treedataarray, - // autoOpen: false, - // dragAndDrop: true, - // onCreateLi: function(node, $li) { - // ////console.log("node >>",node); - // } - // }).on( - // 'tree.contextmenu', - // function(event:any) { - // // The clicked node is 'event.node' - // var node = event.node; - // openMenuDetailsModal(node, "view"); - // } - // ); + console.log("treedataarray>>>>",treedataarray); + $(function() { + ($('#jqTree')).tree('loadData', treedataarray); + ($('#jqTree')).tree({ + data: treedataarray, + autoOpen: false, + dragAndDrop: true, + onCreateLi: function(node, $li) { + ////console.log("node >>",node); + } + }).on( + 'tree.contextmenu', + function(event:any) { + // The clicked node is 'event.node' + var node = event.node; + openMenuDetailsModal(node, "view"); + } + ); - // var openMenuDetailsModal = function(node: any, actionName: string ){ - // const modalRef = ngbModal.open(FunctionalMenuDialogComponent, { size: 'lg' }); - // modalRef.componentInstance.title = 'Functional Menu ',actionName; - // if(node != 'undefined' && node){ - // modalRef.componentInstance.nodedata = node; - // modalRef.componentInstance.operationName = actionName; - // }else{ - // modalRef.componentInstance.nodedata = {}; - // } - // modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { - // //console.log("receivedEntry>>>>",receivedEntry); - // ngbModal.dismissAll(); - // if(receivedEntry.httpStatusCode===200){ - // _self.getFunctionalMenu(); - // } - // }); - // } - // }); - // } + var openMenuDetailsModal = function(node: any, actionName: string ){ + const modalRef = ngbModal.open(FunctionalMenuDialogComponent, { size: 'lg' }); + modalRef.componentInstance.title = 'Functional Menu ',actionName; + if(node != 'undefined' && node){ + modalRef.componentInstance.nodedata = node; + modalRef.componentInstance.operationName = actionName; + }else{ + modalRef.componentInstance.nodedata = {}; + } + modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + //console.log("receivedEntry>>>>",receivedEntry); + ngbModal.dismissAll(); + if(receivedEntry.httpStatusCode===200){ + _self.getFunctionalMenu(); + } + }); + } + }); } } -- 2.16.6