tail.select.js
tail.select.js copied to clipboard
How to avoid the loop when removing all options
I'm using the select to fetch some data for a calendar (fullcalendar.js) like this
var select_categories = tail.select(".select-categories", {
search: true,
multiSelectAll: true,
locale: 'fr',
});
select_categories.on("change", function(){
calendar.refetchEvents();
}
the select has 19 options and it works great, but when i clic on "All" or "Remove all" the calendar.refetchEvents() event is called 19 times making 19 ajax requests which make the calendar very slow. In this situation how can i do to make only one request ?
Can you cache the result of the refetchEvents()? I don't know how exactly it's working.
Also, if you think this is a tail.select issue, feel free to submit a PR.