From 1ad9439162375e00688f7b22e8bbb6338bafcb76 Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 9 Jan 2017 15:02:10 +0530 Subject: [PATCH] Add select2 controller to select roles to share a group --- .../app/pages/cdmf.page.groups/groups.hbs | 21 +++++++++-- .../cdmf.page.groups/public/js/listing.js | 37 +++++-------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index da79afe1bd1..198890e4ba2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -119,10 +119,9 @@

Select user role(s) -

-
-

+
+
'; - $('.roleCheckBoxes').each( - function () { - if (data.roles[i] == $(this).data('role-name')) { - $(this).attr('checked', true); - } - } - ); + html += ''; } + html += ''; $("#rolesListing").html(html); markAlreadySavedUsersRoles(groupId); + $("select.select2[multiple=multiple]").select2({ + tags: false + }); } else { $("#rolesListing").html("No roles available"); }