extjs4 里面怎么监听滚动条?
同一窗口两个grid要对比,拉动其中一个grid的滚动条,同时另一个也跟着移动不要用这个方法grid.getView().on('bodyscroll',function...
同一窗口两个grid要对比,拉动其中一个grid的滚动条,同时另一个也跟着移动
不要用这个方法
grid.getView().on('bodyscroll', function(event, target){
grid2.getView().setScrollTop(target.scrollTop);
grid2.getView().setScrollLeft(target.scrollLeft);
});
grid2.getView().on('bodyscroll', function(event, target){
grid.getView().setScrollTop(target.scrollTop);
grid.getView().setScrollLeft(target.scrollLeft);
});
这样写,但是它报错说 没有setScrollTop属性和方法,但是左右同步是可以的
上下滚动同步要怎么实现 展开
不要用这个方法
grid.getView().on('bodyscroll', function(event, target){
grid2.getView().setScrollTop(target.scrollTop);
grid2.getView().setScrollLeft(target.scrollLeft);
});
grid2.getView().on('bodyscroll', function(event, target){
grid.getView().setScrollTop(target.scrollTop);
grid.getView().setScrollLeft(target.scrollLeft);
});
这样写,但是它报错说 没有setScrollTop属性和方法,但是左右同步是可以的
上下滚动同步要怎么实现 展开
2015-07-12 · 知道合伙人数码行家
关注
展开全部
设置scrollable:true.
如果内容超过panel的宽度、高度就会出现滚动条
scrollable : Boolean/String/Object
Configuration options to make this Component scrollable. Acceptable values are:
true to enable auto scrolling.
false (or null) to disable scrolling - this is the default.
x or horizontal to enable horizontal scrolling only
y or vertical to enable vertical scrolling only
Also accepts a configuration object for a Ext.scroll.Scroller if if advanced configuration is needed.
The getter for this config returns the Scroller instance. You can use the Scroller API to read or manipulate the scroll position:
如果内容超过panel的宽度、高度就会出现滚动条
scrollable : Boolean/String/Object
Configuration options to make this Component scrollable. Acceptable values are:
true to enable auto scrolling.
false (or null) to disable scrolling - this is the default.
x or horizontal to enable horizontal scrolling only
y or vertical to enable vertical scrolling only
Also accepts a configuration object for a Ext.scroll.Scroller if if advanced configuration is needed.
The getter for this config returns the Scroller instance. You can use the Scroller API to read or manipulate the scroll position:
2014-12-19
展开全部
onscroll="document.getElementById('id').scrollTop = this.scrollTop;document.getElementById('id').scrollLeft = this.scrollLeft;"
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询