admin管理员组文章数量:1332889
I have two Ext.Panels, one the scrollingContent, inside another, called wrapper. Wrapper is less large than scrollingContent, so the latter scrolls horizontaly inside his wrapper.
I would like to handle scroll events and the position of scrollingContent inside wrapper after each scroll.
I did not find any solution for this. Any help would be really really appreciated.
Thanks in advance
var scrollingContent = new Ext.Panel({
id: 'p1',
layout: 'hbox',
width: 1200,
height: 380,
//cls: 'blue',
items: itemList
});
var wrapper = new Ext.Panel({
id: 'p2',
scroll: 'horizontal',
width: 800,
height: 380,
cls: 'gray',
items: scrollingContent
});
I have two Ext.Panels, one the scrollingContent, inside another, called wrapper. Wrapper is less large than scrollingContent, so the latter scrolls horizontaly inside his wrapper.
I would like to handle scroll events and the position of scrollingContent inside wrapper after each scroll.
I did not find any solution for this. Any help would be really really appreciated.
Thanks in advance
var scrollingContent = new Ext.Panel({
id: 'p1',
layout: 'hbox',
width: 1200,
height: 380,
//cls: 'blue',
items: itemList
});
var wrapper = new Ext.Panel({
id: 'p2',
scroll: 'horizontal',
width: 800,
height: 380,
cls: 'gray',
items: scrollingContent
});
Share
Improve this question
edited Aug 19, 2010 at 19:22
Anurag
142k37 gold badges222 silver badges261 bronze badges
asked Aug 19, 2010 at 12:57
herve.rtherve.rt
11 silver badge2 bronze badges
1 Answer
Reset to default 5To access the scroll event of wrapper, access its Scroller after it renders:
var wrapper = new Ext.Panel({
id: 'p2',
scroll: 'horizontal',
width: 800,
height: 380,
cls: 'gray',
items: scrollingContent,
listeners: {
afterrender: function(p) {
// p is this Ext.Component == wrapper
p.scroller.on('scroll',handleScroll);
}
}
});
/**
* Called when wrapper scrolls
*/
function handleScroll(scrollerObject,offsetObject) {
// Do your stuff here
}
Be aware that this event will fire continuously, not just when the scroll starts. If you want that functionality, use the scrollstart event instead.
Here's where I found the info: http://www.sencha./forum/showthread.php?110240-How-to-add-scroll-event-to-Ext.form.FormPanel&s=a478f8ee91ba4cfde57845bf6229c902
For more information on the Scroller class and what it exposes, see the API doc: http://dev.sencha./deploy/touch/docs/?class=Ext.util.Scroller
本文标签: javascriptHow to handle scroll events on ExtPanels in Ext Touch (Sencha Touch)Stack Overflow
版权声明:本文标题:javascript - How to handle scroll events on Ext.Panels in Ext Touch (Sencha Touch)? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742314714a2451584.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论