I have initialized multiple CalHeatMap objects on a single page:
....
{% for row in queryset %}
var cal{{ forloop.counter }} = new.CalHeatMap();
cal{{ forloop.counter }}.init(
{id:"cal{{ forloop.counter }}", itemSelector: "#previousSelector-a", previousSelector: "#previousSelector-a-previous", domain: 'day', subDomain:'hour', colLimit: 24, range: 4, displayLegend: false, domainLabelFormat: ""}
);
{% endfor %}
....
{% for row in queryset %}
<div id="cal{{ forloop.counter }}"></div>
{% endfor %}
<div id="previousSelector-a" style="nullposition:relative;">
<button class="btn" id="previousSelector-a-previous">Previous</button>
</div>
but I want to be able to use the previous and next selectors so they when I click on them they will progress all calendars not just the last calendar as is the case now?
Use the
itemNamespace
option, and assign a different namespace to each calendar instance.