Whenever I click on an event in the calendar, a popup window appears displaying textboxes and a list of items. The issue arises when I close the popup after selecting an event with items in the list; the same items show up for other events without refreshing the page, even though they have different ids.
How can I clear the item list when closing the popup so that only items related to the selected event are displayed for other events?
Below is the section of code where the list is called:
var scheduleData = { scheduleId: calEvent.id };
$.ajax({
type: 'POST',
traditional: true,
url: '/Schedule/JsonGetItemsBySchedule/',
datatype: 'json',
data: scheduleData,
success: function (result) {
var itemlist = result.items; loopItems(itemlist);
}
});