2017-04-13 5 views
0

스크롤 막대가있는 ExtJS에 그리드 패널이 있습니다. 나는 사용자가 모든 방법으로 아래로 스크롤했을 때이를 감지하여 막대를 더 이상 움직일 수 없도록하려고합니다. 지금까지 내가 스크롤을 발생하지만 스크롤 막대가있는 위치에 대한 정보 (?)를 제공합니다 감지합니다.ExtJS Grid Panel에서 스크롤 이벤트가 발생합니까?

//bufferedGrid is a grid panel 
this.randomGrid.getView().on('scroll', this.onRandomGridScroll, this); 
. 
. 
. 
onRandomGridScroll : function(e, t) 
{ 
    console.log(e); 
    console.log(t); 

} 

모든 포인터가 감사하겠습니다. 감사!

onBufferedGridScroll : function(e, t) 
    { 
     var max = this.bufferedGrid.getView().el.dom.scrollTopMax; 
     var current = this.bufferedGrid.getView().el.dom.scrollTop; 
     if(current == max) 
      alert('You have reached the bottom of the scroll !'); 
    } 
+0

당신은 onViewScroll를 오버라이드 (override) 할 필요가 있습니다() 버퍼 그리드 Ext.grid.plugin.BufferedRenderer 클래스의. – Tejas

+0

@ Tejas1991 "bufferedGrid"는 단지 이름입니다 ... 플러그인을 언급하지 않습니다 – Pepria

+0

버퍼가 달린 그리드 (페이지 매김 그리드)를 사용하고 있습니까? 그래서 당신은 내가 말하거나이 그리드에 스크롤 이벤트를 바인드 할 필요가있는 동일한 메소드를 오버라이드해야 할 것이다. – Tejas

답변

0

당신은 현재의 스크롤 막대 위치에 액세스 할 수는 (실제로, 스크롤 막대의 위쪽) 및 최대 스크롤 위치 (파이어 폭스에서 작동하지만을 크롬되지 않음)를 다음과 같이 init 그리드가 렌더링 된 후에 mouseup 이벤트와 wheel down 이벤트를 추가하십시오.

'container #gridId':{ afterrender: this.addScrollEventListener }

addScrollEventListener: function(comp){ 
    comp.getTargetEl().on('mouseup', function(e, t) { 
     var height = comp.getTargetEl().getHeight(); 
     if (height + t.scrollTop >= t.scrollHeight) { 

     } 
    }); 
    comp.getTargetEl().on('wheeldown', function(e, t) { 
     var height = comp.getTargetEl().getHeight(); 
     if (height + t.scrollTop >= t.scrollHeight) { 

     } 
    }); 
} 
0

는에 이벤트 추가 :