2

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.

Val
  • 173
  • 2
  • 10
  • the main issue turned out to be the fact that I had a 'locked' column, kudos to @Lolo for providing a jsfiddle, it enabled me to locate the problem. – Val Nov 28 '12 at 18:32

1 Answers1

2

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/

Krzysztof
  • 15,900
  • 2
  • 46
  • 76