2012-02-14 1 views
1

새로 고침 단추에 대한 사용자 지정 설치가 없으므로이를 숨기거나 제거하려고합니다. hideRefresh: true이 작동하지 않았습니다. 숨길 수있는 방법이없는 경우 버튼을 클릭하면ExtJs Ext.PagingToolbar : 새로 고침 버튼 onclick의 매개 변수를 숨기거나 설정 하시겠습니까?

, 나는 적어도 일부 매개 변수를 전달할 수 있습니다, 그래서 그것을 몇 가지 의미있는 작업을 수행 할 수 있습니까?

pPanel = new Ext.Panel({ 
    applyTo: 'newProgWin', 
    autoScroll:true, 
    styleClass: 'formInput', 
    bodyStyle: 'overflow-x: hidden', 
    align: 'center', 
    layout:'fit', 
    width:899, 
    height:450, 
    closeAction:'hide', 
    plain: true, 
    items: winDataView = new Ext.DataView({ 
     tpl: resultTpl, 
     store: npDs, 
     itemSelector: 'div.search-item' 
    }), 

    tbar: [ 
       'Search: ', ' ', 
      (winSearchField = new Ext.ux.form.SearchField({ 
       store: npDs, 
       width:300 
      })) 
     ], 
    bbar: new Ext.PagingToolbar({ 
       beforeLoad : function() 
       { 
        pocProxy.extraParams = { 
         eps: currentProgs, 
         stateful: true, 
         dataCall: dataCallId, 
         orgNameConvention: currentOnc, 
         installation: currentInstallation 
        }; 
       }, 
       store: npDs, 
       pageSize: pageSize, 
       displayInfo: true, 
       //hideRefresh: true, 
       displayMsg: 'Organizations {0} - {1} of {2}', 
       emptyMsg: "No Organizations available to display" 

      }) 
}); 

답변

4

Ext.PagingToolbar에 hideRefresh 속성이 없습니다.

당신은 bbar합니다 (Ext.PagingToolbar 인스턴스) 객체를 통해 새로 고침 버튼에 액세스 할 수 있습니다.

pPanel.bbar.refresh

당신은 hide() 기능을 사용하여 숨길 수 있습니다.

pPanel.bbar.refresh.hide()

또한 Ext.PagingToolbar에 afterrender 이벤트에 숨길 수 :

listeners: { 
    afterrender: function() { 
     this.refresh.hide(); 
    } 
} 

당신은 bbar에 doRefresh 기능을 재정 의하여 새로 고침 버튼의 동작을 수정할 수 있습니다

pPanel.bbar.doRefresh

코드와 관련하여 beforeLoad 함수를 재정의하는 것이 좋습니다. 의도적 인 경우가 아니면 내면의 수리를 할 것입니다. 어쩌면 상점 개체로 옮길 것인가?

은 디버깅을 도와 때문에 당신은뿐만 아니라 문서와 코드를 확인해야합니다.

+0

안녕하세요, CincauHangus. 실제로 내가 시도하고 숨기기 메서드,하지만 어떻게 든 pPanel.bbar.refresh 아무것도 반환하지 않습니다. 청취자와 함께 숨기기 위해 나를 위해 작동합니다. 덕분에 도움을 많이 :) – JoJoAngel

+0

다행스럽게 도와 줬어. 귀하의 질문에 만족하는 경우 내 대답을 해결책으로 표시하십시오. 감사 – CincauHangus

1
listeners:{ 
    afterrender:function(){ 
     var a = Ext.query("button[data-qtip=Refresh]"); 
     for(var x=0;x < a.length;x++) 
     { 
      a[x].style.display="none"; 
     } 
    } 
} 
1

이 코드는 나를 위해 잘 작동 이 코드를 사용하려면 :

var toolbar = this.lookupReference('pagingtoolbar');  
toolbar.on('afterrender', function() { 
    this.getComponent('refresh').hide(); 
}); 
-1

하면 매김 도구 모음에 일부 작은 폭을 제공 할 수 있습니다 :)

0

P는 ExtJS 6.2에서 나는했다 : 새로 고침 구성 요소가 숨겨져 가도록 (듯이)

this.bbar = Ext.create('Ext.PagingToolbar', { 
      store: 'Interactions', 
      displayInfo: false, 
      preprendButtons: false, 
      listeners: { 
       afterrender : function() { 
        this.child('#refresh').hide(); 
       } 
      } 
     });