From 378dd4084ccb0b1b0c3dc31675435fb95f0aac45 Mon Sep 17 00:00:00 2001 From: dilanua Date: Mon, 26 Sep 2016 17:27:57 +0530 Subject: [PATCH] FIX for JIRAS: https://wso2.org/jira/browse/EMM-1591,EMM-1590,EMM-1585 --- .../dataTables.extended.serversidepaging.js | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js index 3b2fddb1950..9ca860900b1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.serversidepaging.js @@ -37,6 +37,10 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte if (InitiateViewOption) { $(".viewEnabledIcon").bind("click", InitiateViewOption); } + + var deviceType; + var ownership; + //--- End of EMM related codes $(elem).DataTable( @@ -108,14 +112,32 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte .draw(); if (filterColumn.eq(column.index()).hasClass('data-platform')) { - if (!val) { + deviceType = val; + if (!deviceType || !ownership) { $("#operation-bar").addClass("hidden"); $("#operation-guide").removeClass("hidden"); } else { $("#operation-guide").addClass("hidden"); $("#operation-bar").removeClass("hidden"); //noinspection JSUnresolvedFunction - loadOperationBar(val); + if (deviceType && ownership) { + loadOperationBar(deviceType, ownership); + } + } + } + + if (filterColumn.eq(column.index()).hasClass('data-ownership')) { + ownership = val; + if (!deviceType || !ownership) { + $("#operation-bar").addClass("hidden"); + $("#operation-guide").removeClass("hidden"); + } else { + $("#operation-guide").addClass("hidden"); + $("#operation-bar").removeClass("hidden"); + //noinspection JSUnresolvedFunction + if (deviceType && ownership) { + loadOperationBar(deviceType, ownership); + } } } });