diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js index 7d8ec0622d..1241ba7fe6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js @@ -228,11 +228,11 @@ function resetPassword(uname) { * when a user type on the search field on User Listing page in * WSO2 MDM Console then click on the search button. */ -$("#search-btn").click(function () { - var searchQuery = $("#search-by-username").val(); - $("#ast-container").empty(); - loadUsers(searchQuery); -}); +//$("#search-btn").click(function () { +// var searchQuery = $("#search-by-username").val(); +// $("#ast-container").empty(); +// loadUsers(searchQuery); +//}); /** * Following function would execute @@ -248,94 +248,113 @@ function InitiateViewOption() { } } -function loadUsers(searchParam) { - - - $("#loading-content").show(); +function loadUsers() { + var loadingContentView = "#loading-content"; + $(loadingContentView).show(); - - var dataFilter = function(data){ + var dataFilter = function (data) { data = JSON.parse(data); var objects = []; - $(data.users).each(function( index ) { + $(data.users).each( function (index) { objects.push({ filter: data.users[index].username, - firstname: data.users[index].firstname ? data.users[index].firstname: '' , + firstname: data.users[index].firstname ? data.users[index].firstname : '' , lastname: data.users[index].lastname ? data.users[index].lastname : '', - emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress: '', - DT_RowId : "role-" + data.users[index].username}) + emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress : '', + DT_RowId : "user-" + data.users[index].username}) }); - json = { + var json = { "recordsTotal": data.count, "recordsFiltered": data.count, "data": objects }; - return JSON.stringify( json ); - } + return JSON.stringify(json); + }; - var fnCreatedRow = function( nRow, aData, iDataIndex ) { + //noinspection JSUnusedLocalSymbols + var fnCreatedRow = function (nRow, aData, iDataIndex) { $(nRow).attr('data-type', 'selectable'); $(nRow).attr('data-username', aData["filter"]); - } + }; + //noinspection JSUnusedLocalSymbols var columns = [ { class: "remove-padding icon-only content-fill", data: null, - defaultContent: '