Multiple Calendars on same page with cal-heatmap p

2019-09-02 07:45发布

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?

http://jsfiddle.net/mbdtsmh/ncW59/1/

1条回答
何必那么认真
2楼-- · 2019-09-02 08:08

Use the itemNamespace option, and assign a different namespace to each calendar instance.

查看更多
登录 后发表回答