0

我在一个页面上初始化了多个 CalHeatMap 对象:

....
{% 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>

但我希望能够使用上一个和下一个选择器,这样当我点击它们时,它们会推进所有日历,而不仅仅是像现在这样的最后一个日历?

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

4

1 回答 1

1

使用该itemNamespace选项,并为每个日历实例分配不同的命名空间。

于 2013-12-02T01:34:16.260 回答