PDA

View Full Version : configuring a scroll event on a panel



stetou
8 Apr 2010, 9:24 AM
Hi,
I'm trying without success to catch a scroll event when the user scroll on the panel. Here is how I do it.
How should I do that please?
thanks
Steve



{
region:'east',
xtype: 'panel',
margins: '5 5 5 0',
width: 400,
title: "Statut de la veille météorologique",
collapsible: true,
autoScroll: true,
listeners:
{
'scroll': function()
{
alert("scrolling");
map.updateSize();
}
},
items:
[
{
xtype: 'gx_mappanel',
layout: 'fit',
map: map,
height: 400,
width: 400,
border: true,
center: new OpenLayers.LonLat(point.x, point.y),
zoom: 5
},
{
contentEl:'divMapAvertissements',
border: false
}
]
}

Animal
8 Apr 2010, 9:39 AM
This keeps coming up.

http://www.extjs.com/forum/showthread.php?t=56583&highlight=add+value+events+DOM

stetou
19 May 2010, 9:21 AM
From this suggested thread I tried without success


listeners:
{
render: function(c)
{
c.getEl().on('scroll', function()
{
alert("scrolling");
},
c);
}
}


It works using the click event...
How I get the scroll event on a xtype: 'panel'?
thanks
steve

markguinn
14 Feb 2011, 8:14 AM
This worked for me:

listeners:{
render: function(c){
c.scroller.on('scrollend', function(){ console.log('scrolled'); });
c.scroller.on('scrollstart', function(){ console.log('scrolling'); });
c.scroller.on('scroll', function(){ console.log('scroll'); });
}
}

I'm using v1.0.1a