2

We have two grids in a panel and we need to have their records to scroll together vertically. That is, if user scrolls any one of the grid vertically then other grid scrolls too.

Thus, what can be the way to bind their vertical scrollbars?

A solution for version 4.0.2a is present here but the functions used have been deprecated in 4.1 version and thus it does not work in the newer versions.

Could anyone guide on how to achieve this in ExtJs version 4.1.*?

Thanks for any help in advance.

4

3 に答える 3

8

API に便利なものは何もありませんが、html 要素に接続することは可能です:

grid1.view.getEl().on('scroll', function(e, t) {
    grid2.view.getEl().dom.scrollTop = t.scrollTop;
});
grid2.view.getEl().on('scroll', function(e, t) {
    grid1.view.getEl().dom.scrollTop = t.scrollTop;
});

作業サンプル: http://jsfiddle.net/CSwAH/

于 2012-12-14T08:50:27.913 に答える