From f76af246d7c44c2bb4e4af16352e8a59fdb5c037 Mon Sep 17 00:00:00 2001 From: Siva Bavanasi Date: Thu, 7 May 2015 17:05:00 +0530 Subject: [PATCH] Closes-bug: #1447290 - Gearbox for BGP Peer doesn't have delete action Change-Id: I25358670ff819a18220c5c0cf4ca66f044b9ea7f --- webroot/config/bgp/ui/js/bgp_config.js | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/webroot/config/bgp/ui/js/bgp_config.js b/webroot/config/bgp/ui/js/bgp_config.js index a72499813..732dbcbe2 100644 --- a/webroot/config/bgp/ui/js/bgp_config.js +++ b/webroot/config/bgp/ui/js/bgp_config.js @@ -870,6 +870,13 @@ function initComponents() { onClick: function(rowIndex){ onActionChange('edit-control',rowIndex); } + }, + { + title: 'Delete', + iconClass: 'icon-trash', + onClick: function(rowIndex){ + showRemoveWindow(rowIndex); + } } ], detail: { @@ -961,6 +968,30 @@ function initComponents() { $('#confirmPeers').modal({backdrop:'static', keyboard: false, show:false}); } +function showRemoveWindow(rowIndex) { + $.contrailBootstrapModal({ + id: 'confirmRemove', + title: 'Remove', + body: '
Confirm BGP Router delete
', + footer: [{ + title: 'Cancel', + onclick: 'close', + }, + { + id: 'btnRemovePopupOK', + title: 'Confirm', + rowIdentifier: rowIndex, + onclick: function(){ + var rowNum = this.rowIdentifier; + var selected_row = $("#gridBGP").data("contrailGrid")._dataView.getItem(rowNum); + deleteBgp([selected_row]); + $('#confirmRemove').modal('hide'); + }, + className: 'btn-primary' + }] + }); +} + function onAuthTypeChanged(e) { if(e.added.value === 'none') { $('#txtAuthKey').val(' ');