diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js
index 40d7ee1d6b..1c2d01b26b 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js
@@ -65,7 +65,9 @@ function onRequest(context) {
"type": data[i],
"category": deviceType.category,
"label": deviceType.label,
- "thumb": utility.getDeviceThumb(data[i])
+ "thumb": utility.getDeviceThumb(data[i]),
+ "analyticsEnabled": deviceType.analyticsEnabled,
+ "groupingEnabled": deviceType.groupingEnabled
});
}
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js
index a340b0e6f2..65c74e886c 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js
@@ -66,7 +66,7 @@ $(document).ready(function () {
$.hasPermission = function (permission) {
return permissionSet[permission];
};
-
+
deviceListing = $("#device-listing");
currentUser = deviceListing.data("current-user");
@@ -246,7 +246,7 @@ function loadDevices(searchType, searchParam) {
return true;
}
// In JS Boolean("false") returns TRUE => http://stackoverflow.com/a/264037/1560536
- return (analyticsEnabled == "true");
+ return (groupingEnabled == "true");
}
}
return true;
@@ -351,7 +351,7 @@ function loadDevices(searchType, searchParam) {
'Analytics';
}
- if (!groupName || !groupId) {
+ if ((!groupName || !groupId) && groupingEnabled(row.deviceType)) {
html +=
'