From f61b929bfd47a1175c68a57ac0d7e4314a94db27 Mon Sep 17 00:00:00 2001 From: dilanua Date: Thu, 18 Aug 2016 18:11:31 +0530 Subject: [PATCH] Updating data-tables API - UI --- .../devicemgt/api/data-tables-invoker-api.jag | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag index 05ca19906ae..0fb2945cf49 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/data-tables-invoker-api.jag @@ -35,18 +35,20 @@ function appendQueryParam (url, queryParam , value) { if (uriMatcher.match("/{context}/api/data-tables/invoker")) { var url = request.getParameter("url"); var targetURL = devicemgtProps["httpsURL"] + request.getParameter("url"); + //noinspection JSUnresolvedFunction getAllParameters var allParams = request.getAllParameters(); - for (var key in allParams) { - if (allParams.hasOwnProperty(key)) { - if(key == "limit" || key == "offset"){ - targetURL = appendQueryParam(targetURL, key, allParams[key]); - } - if(key == "filter"){ - if(allParams[key]){ - var searchPayload = JSON.parse(allParams[key]); - for (var key in searchPayload) { - targetURL = appendQueryParam(targetURL, key, searchPayload[key]); + for (var allParamsKey in allParams) { + if (allParams.hasOwnProperty(allParamsKey)) { + if (allParamsKey == "limit" || allParamsKey == "offset") { + targetURL = appendQueryParam(targetURL, allParamsKey, allParams[allParamsKey]); + } else if (allParamsKey == "filter") { + if (allParams[allParamsKey]) { + var searchPayload = JSON.parse(allParams[allParamsKey]); + for (var searchPayloadKey in searchPayload) { + if (searchPayload.hasOwnProperty(searchPayloadKey)) { + targetURL = appendQueryParam(targetURL, searchPayloadKey, searchPayload[searchPayloadKey]); + } } } }