Scrolling events in ListView in ExtJS3.x

I have a ListView in ExtJs3.1 and I tried to listen for the 'scroll' event. Most of the examples I've seen for controls like panels indicate the following:

panel.body.on ('scroll', function (a, b, c) {// set the logic here});

now the problem with ListView is that it does not have a body attribute, not what I saw in fireBug. I tried adding an event to innerBody in the listView, but obviously this did nothing.

Any help would be greatly appreciated. Thanks

I am sure that I am missing something very basic, but I spent about 2 hours flipping through the Docs and source files.

+4
source share
2 answers

I found a workaround!

Although the listView does not expose the body attribute as such, this does not mean that we cannot access the body. using the CSS selector, I got the body of a listView by doing the following:

var body = listView.el.child ('body x-list.');

This body variable has an XType Ext.Element, and now I can listen to the scroll event, and also call the scroll method and scollIntoView method.

+2
source

is the list scroll itself or panel body?

0
source

All Articles