View Full Version : How to relay a body scroll

20 Aug 2013, 2:41 AM
I have a class defined like below with a body scroll listener, how do I relay this bodyscroll listener to a class that will implement this grid:

MyGridPanel=Ext.extend (file:///E:/ext-!/api/Ext-method-extend)(Ext.grid.GridPanel (file:///E:/ext-!/api/Ext.grid.GridPanel),{
Create configuration for this Grid.
var store =newExt.data.Store (file:///E:/ext-!/api/Ext.data.Store)({...});
var colModel =newExt.grid.ColumnModel (file:///E:/ext-!/api/Ext.grid.ColumnModel)({...});
// Create a new config object containing our computed properties// *plus* whatever was in the config parameter.
config =Ext.apply (file:///E:/ext-!/api/Ext-method-apply)({ store: store,
colModel: colModel,
listeners: { 'bodyScroll': function (scrollLeft, scrollTop){

}, config);MyGridPanel.superclass.constructor.call(this, config);// Your postprocessing here
this.relayEvents(['bodyScroll']); },
yourMethod:function(){// etc.} });

20 Aug 2013, 6:56 AM
Any Ideas please

22 Aug 2013, 9:01 AM
If you're wanting to have component B listen to component A's events you can relay the events from A to B using relayEvents:

gridB.relayEvents(gridA, ['bodyscroll']);

Then you can add a bodyscroll event listener to gridB which will be called when gridA's bodyscroll event is fired.