From 71c614aba26915202140d71a962621cab7029ccf Mon Sep 17 00:00:00 2001 From: yuhao10 Date: Mon, 31 Oct 2016 21:19:00 +0800 Subject: fix controller can not delete bug controller can not delete cause we use sdncontrollerid as uuid in brs model but we use id as index to delete controller in html SDNO-805 Change-Id: Ibdb69b1d10b24725a9847953ce3a2b838362c518 Signed-off-by: yuhao10 --- .../src/main/webapp/extsys/sdncontroller/controller.html | 2 +- .../src/main/webapp/extsys/sdncontroller/js/controller.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'openo-portal') diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html index 62bc2d9a..1d38c414 100644 --- a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html +++ b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/controller.html @@ -42,7 +42,7 @@ window.operateEvents = { 'click .siteDeleteImg': function (e, value, row, index) { // TO DO ajex call for delete - deleteController(row.id, row); + deleteController(row["sdnControllerId"]); } }; diff --git a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js index df0fef51..b420c604 100644 --- a/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js +++ b/openo-portal/portal-extsys/src/main/webapp/extsys/sdncontroller/js/controller.js @@ -37,7 +37,7 @@ function deleteController(objectId) { contentType: "application/json", success: function (jsonobj) { $('#controller').bootstrapTable('remove', { - field: 'id', + field: 'sdnControllerId', values: [objectId] }); alert("Delete Controller successfull !!!"); @@ -144,7 +144,6 @@ $(function () { $('#createController').click(function () { var formData = JSON.stringify($("#controllerForm").serializeObject()); - var jsonobj = JSON.parse(formData); var requestUrl = "/openoapi/extsys/v1/sdncontrollers"; $.ajax({ type: "POST", @@ -154,8 +153,7 @@ $(function () { data: formData, success: function (jsonResp) { alert("Controller saved successfully!!!"); - jsonobj["id"] = jsonResp.sdnControllerId; - $('#controller').bootstrapTable("append", jsonobj); + $('#controller').bootstrapTable("append", jsonResp); $('#vmAppDialog').removeClass('in').css('display', 'none'); }, -- cgit 1.2.3-korg