| 26014 |
amit.gupta |
1 |
$(document).on('click', 'a.category-level', function(){
|
| 33995 |
vikas.jang |
2 |
var table = $('#ticket-category').DataTable();
|
|
|
3 |
table.$('td').removeClass('highlight');
|
| 31905 |
amit.gupta |
4 |
let category = $(this).data("category");
|
|
|
5 |
let level = $(this).data("level");
|
|
|
6 |
doGetAjaxRequestHandler(context + "/admin/resources?ticketCategoryId=" + category + "&escalationType=" + level, function (response) {
|
| 26014 |
amit.gupta |
7 |
response = JSON.parse(response);
|
| 31905 |
amit.gupta |
8 |
$("#access-resource").find(":input").each(function (index, element) {
|
| 26014 |
amit.gupta |
9 |
console.log($(element).data("menuid"));
|
| 31905 |
amit.gupta |
10 |
element.checked = response.indexOf($(element).data("menuid")) > -1;
|
| 26014 |
amit.gupta |
11 |
});
|
|
|
12 |
});
|
|
|
13 |
$("#access-resource th").html("Resources for " + $(this).html());
|
|
|
14 |
$(this).closest('td').addClass('highlight');
|
|
|
15 |
});
|
|
|
16 |
$(document).on('change', '#access-resource :checkbox', function(){
|
|
|
17 |
var menuId = $(this).data("menuid");
|
|
|
18 |
if($("#ticket-category td.highlight").length == 0) {
|
|
|
19 |
bootbox.alert("Please choose Category!");
|
|
|
20 |
return false;
|
|
|
21 |
}
|
|
|
22 |
var highlightedAnchor = $("#ticket-category td.highlight").find('a');
|
|
|
23 |
var category = highlightedAnchor.data("category");
|
|
|
24 |
var level = highlightedAnchor.data("level");
|
|
|
25 |
doGetAjaxRequestHandler(context + "/admin/toggleResourcePermission?ticketCategoryId="+category+"&escalationType="+level+"&menuId=" + menuId, function(response) {
|
|
|
26 |
});
|
|
|
27 |
});
|