问题
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