function changeResourceSelection(popupId, url, listId, listItemIdPrefix, checkBoxIdPrefix, filterAppointmentsUrl) { var selectedOids = []; var oidString = ""; $("#" + popupId + " input:checked").each(function () { var id = $(this).attr("id"); selectedOids.push(id.split("-")[1]); }); for (var i = 0; i < selectedOids.length; i++) { oidString += selectedOids[i] + ","; } $.get(url, { resourceOids: oidString }).done(function (jsonResult) { updateSelectedResourceList(jsonResult, listId, listItemIdPrefix, popupId, checkBoxIdPrefix, url, filterAppointmentsUrl); $("#one-day-scheduler-partial-container").load(filterAppointmentsUrl); }); } function updateSelectedResourceList(jsonResult, listId, listItemIdPrefix, popupId, checkBoxIdPrefix, url, filterAppointmentsUrl) { var list = $("#" + listId); list.empty(); if (isEmptyOrSpaces(jsonResult)) { return; } var resourceList = $.parseJSON(jsonResult); $.each(resourceList, function (index, customListItem) { var listItemId = listItemIdPrefix + customListItem.ResourceOid; var checkBoxId = "resource-" + customListItem.ResourceOid + checkBoxIdPrefix + ""; var html = "
" + "
" + "
" + "
" + "" + "
" + "

" + customListItem.Name + "

" + "

" + "" + "
" + "
" + "
" + "
"; list.append(html); }); } // ToDo: FetchAppointments-Url hinzufügen function removeSelectedResource(listItemId, checkBoxId, popupId, url, listId, fetchAppointmentsUrl) { $("#" + listItemId).remove(); var checkbox = $("#" + checkBoxId); if (checkbox.length) { checkbox.prop("checked", false); } changeResourceSelection(popupId, url, listId, null, null, fetchAppointmentsUrl); }