2012-12-12 7 views

risposta

10

Se si desidera solo per fare è una volta utilizzare

Ext.create('Ext.PagingToolbar', { 
     store: store, 
     displayInfo: true, 
     displayMsg: 'Displaying records {0} - {1} of {2}', 
     emptyMsg: "No topics to display", 
     doRefresh : function(){ 
     // Keep or remove these code 
     var me = this, 
      current = me.store.currentPage; 

     if (me.fireEvent('beforechange', me, current) !== false) { 
      me.store.loadPage(current); 
     } 
     } 
}); 

o per tutti i pagebars.

Ext.PagingToolbar.prototype.doRefresh = function() { 
    // Keep or remove these code 
    var me = this, 
     current = me.store.currentPage; 

    if (me.fireEvent('beforechange', me, current) !== false) { 
     me.store.loadPage(current); 
    } 
} 

Nota che se stai facendo in modo da avere un doppio controllo che ogni volta che si aggiorna il nucleo ExtJS per garantire la funzionalità!

+0

thnx, esattamente fullfill mia requisiti. –

+0

@ZakariaImtiaz Prego :) Si dovrebbe accettare la risposta corretta con il controllo sotto il numero di voto;) – sra

+0

mi dispiace. come potrei farlo ... –

5
Ext.create('Ext.PagingToolbar', { 
    store: store, 
    displayInfo: true, 
    displayMsg: 'Displaying records {0} - {1} of {2}', 
    emptyMsg: "No topics to display", 
    doRefresh : function(){ 
    var me = this, 
     current = me.store.currentPage; 

    if (me.fireEvent('beforechange', me, current) !== false) { 
     me.store.loadPage(1, {          
      callback: function (records, operation, success) { 
       Ext.getCmp('educationGrid').getSelection(records, operation, success);          
      } 
     }); 
    } 
    } 

});

...................................

getSelection: function(records, operation, success){ 
    var grid= Ext.getCmp('educationGrid'); //my grid 
    grid.getView().select(0); 
}