I can't figure out why it's throwing me an error but when I check if my list is being rendered it is there.
Front end
<div id="calendar-events-list" class="events-listing">
foreach(sample_arr) {
echo '<ul class="events-by-date list"></div>';
}
<nav class="events-calendar-pager events-pager" data-value="">
<a class="page-prev disabled" href="#"></i></a>
<ul class="pagination"></ul>
<a class="page-next" href="#"></i></a>
</nav>';
</div>
Js file
$.ajax({
method: 'post',
url: path+'js/ajax/get-events.php',
data: {
// 'current_month': instance.month,
'current_year': instance.year,
'current_period': instance.current_period,
'action': action,
'views': views,
'limit': instance.limit,
'xid': c_xid
},dataType: 'json'
}).done(function(data){
if($('ul.list li').length){
var events_calendar_options = {
valueNames: ['side'],
pagination: true,
page: 3,
innerWindow: 2,
};
var eventList = eventsPagination('calendar-list', options);
eventList.update();
}
} // close ajax
...
// when user clicked a date from a calendar, the events (my list array) on that date should show
$container.on('click', $element, function(){
if($('ul.list li').length){
var options = {
valueNames: ['side'],
pagination: true,
page: 3,
innerWindow: 2,
};
var eventList = eventsPagination('calendar-list', options);
eventList.update();
}
}
There's nothing wrong with my eventsPagination() function as the other ones are working properly. It just this one is throwing me an error once I change the date and pass thru ajax and then return my new events array. And my list of events array will only show once they click a specific date in the calendar.
Really appreacite your help!