在同一页面上使用cal-heatmap插件的多个日历 [英] Multiple Calendars on same page with cal-heatmap plugin
本文介绍了在同一页面上使用cal-heatmap插件的多个日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一个页面上初始化了多个CalHeatMap对象:
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/
推荐答案
使用 itemNamespace
选项,并为每个日历实例指定不同的命名空间。
Use the itemNamespace
option, and assign a different namespace to each calendar instance.
这篇关于在同一页面上使用cal-heatmap插件的多个日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文