Reputation: 309
I am using a dgrid that has a horizontal scroll bar and column sorting. When the user scrolls to the last column and sorts the column, the scroll position is not retained by dgrid. How can I retain the scroll bar position after the sort is completed ?
var grid = new (declare([OnDemandGrid, DijitRegistry, ColumnResizer]))({
id: "grid",
store: storeForGrid,
maxRowsPerPage: 3,
columns: [ {
field: "Name",
label: "Name"
}, {
field: "LastName",
label: "Last Name"
}, {
field: "BookNumber",
label: "Book Number"
}, {
field: "MaxDays",
label: "Max. Days"
}, {
field: "MinDays",
label: "Min. Days"
} ]
}, this.grid);
I tried to implement the 'dgrid-sort' event callback. By this time the scrollLeft position is reset-ted to 0. Thanks.
Upvotes: 0
Views: 861
Reputation: 10559
Passing keepScrollPosition: true
in your constructor arguments object should do exactly what you are asking for.
Upvotes: 1