From fcd322cb215d892c12d2e07867d817c1fe8d927f Mon Sep 17 00:00:00 2001 From: Sameera Wickramasekara Date: Fri, 15 Sep 2017 15:38:36 +0530 Subject: [PATCH] Update operation status header on click --- .../units/cdmf.unit.device.view/public/js/device-view.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js index c1531a6d062..a7f393bc6a4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js @@ -137,6 +137,7 @@ function loadOperationsLog(update) { var deviceType = $('.device-id').data('type'); var uri = "/api/device-mgt/v1.0/activities/" + rowData.activityId + "/" + deviceType + "/" + deviceid; var contentType = "application/json"; + var index = row[0][0]; if (row.child.isShown()) { row.child.hide(); @@ -145,6 +146,13 @@ function loadOperationsLog(update) { tr.removeClass('shown'); } else { invokerUtil.get(uri,(payload) => { + //update the parent status + var payloadObject = JSON.parse(payload); + if ( payloadObject["activityStatus"][0]["status"] != rowData["status"] ) { + rowData["status"] = payloadObject["activityStatus"][0]["status"]; + $('#operation-log').dataTable().fnUpdate(rowData,index,undefined,false); + } + row.child(renderLogDetails(row.data(),payload)).show(); tr.find('i.fw-down').removeClass('fw-down').addClass('fw-up'); $(row.child()).addClass('log-data-row');