clicking the Calendar arrows next/previous buttons and load the data once stop click
I have a calendar image with previous and next button icon. If I click on the calendar image, calendar popup will open. After selecting the date then loading relevant gridload function. If I click the previous/next icon button, the gridload function execute without open calendar popup. I used the following code for that,var dateText = $(thisElement).parent().find('input.datepicker').datepicker('getDate');
if ($(thisElement).hasClass('left-arrow')) {
dateText.setDate(dateText.getDate() - 1);
}
else if ($(thisElement).hasClass('right-arrow')) {
dateText.setDate(dateText.getDate() + 1);
}
$(thisElement).parent().find('input.datepicker').datepicker('setDate', dateText);
$('.ui-datepicker-current-day').trigger('click');
event.stopImmediatePropagation();
My new requirement is, If I click previous/next button click it fast, trying to go back 2 or 3 days, the system won't try to load the grid data for each of those dates, and will just load it once they stop clicking.
Please help for solving this issue.