2012-12-14 1 views
2

Backbone.js보기의 일부로 jqplot 차트가 있습니다. 차트와 데이터는 모두 잘로드되지만 마우스 강조 표시와 차트를 클릭하면 등록되지 않은 것 같습니다. jqplot 예제에서 잘 작동합니다. Backbone.js 프레임 워크에 추가 할 때만 작동을 멈 춥니 다. 나는 "jqplotDataHighlight"와 "jqplotClick"그들 중 어느 이벤트를 트리거를 사용하여 시도jqplot이 backbone.js보기에서 "jqplotDataClick"이벤트를 트리거하지 않음

, 그러나 "jqplotDataUnhighlight는"잘 작동합니다. 나는 왜 하나가 작동하고 다른 하나는 작동하지 않는지를 알 수 없다.

//part of Backbone.js View.... 
     var l2 = [11, 9, 5, 12, 14];  
     var l3 = [4, 8, 5, 3, 6];  
     var l4 = [12, 6, 13, 11, 2]; 

     //this event never triggers 
     this.$('#plot3').bind('jqplotDataHighlight',   
      function (ev, seriesIndex, pointIndex, data) { 
       alert('highlight');   
       $('#info1b').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);   
      }); 

      //unhighlight event work just as expected 
     this.$('#plot3').bind('jqplotDataUnhighlight',   
       function (ev) { 
        alert("this worked: unhighlight")    
        $('#info1b').html('Nothing');   
     }); 

     //chart load fine, showing all data    
     this.$('#plot3').jqplot([l2, l3, l4],{  
       stackSeries: true,  
       showMarker: false,  
       seriesDefaults: {   
        fill: true  
       },  
       axes: {   
       xaxis: {    
         renderer: $.jqplot.CategoryAxisRenderer,    
         ticks: ["Mon", "Tue", "Wed", "Thr", "Fri"]   
       }  
       }  
      }); 
    }); 

답변

1

글쎄요, 몇 시간이 지난 후에도 제 질문에 대한 답변을 드리겠습니다. 내가하는 것처럼 실수하는 가난한 바보를 도울 것입니다.

테스트 도중 jqplot pluggins을 모두 추가했는데 마침내 모바일 플러그인이 문제를 일으키는 onClich와 같은 주요 jqplot 이벤트 핸들러 중 일부를 재정의한다는 사실을 알게되었습니다. 나는 모바일 플러그인을 제거하고 모든 것이 매력처럼 작동했습니다.