how to scroll extjs 4 grid horizontally

好久不见. 提交于 2019-12-10 10:31:58

问题


What is the proper way to scroll a grid horizontally on load.

I want to scroll to a particular grid column on load.

I can focus the column I want using this:

dataStore.on('load', function() {
     var cl = dataGrid.columns[43];
     cl.focus();
});

but the grid does not scroll when I do this.


回答1:


One possibility is to use scrollByDeltaX. Example:

viewready: function(){
    var c = this.columns[5];
    var p = c.getPosition();

    this.scrollByDeltaX(p[0]);
}

Working sample: http://jsfiddle.net/YRraU/2/



来源:https://stackoverflow.com/questions/13545674/how-to-scroll-extjs-4-grid-horizontally

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!