PDA

View Full Version : preserveScrollOnRefresh: true - working for rows in grid but not headers



ianw
1 Nov 2013, 8:26 AM
Please excuse any ignorance, I am very new to extJS.

Using extJS 4.1

I have a grid loading data from a store. There is lots of data, so there are scroll bars for the grid. I am extending Ext.grid.Panel and setting preserveScrollOnRefresh to true, so that the scroll position is preserved when the data in the grid is reloaded from the data store. This part works fine. The problem is that the headers in the grid, scroll back to their initial position when the grid is reloaded, therefore the headers no longer match the columns they are heading. How do I stop this from happening so that if someone has scrolled and the data reloads the scroll position *and* header position remains after the reload ?


Ext.define('PersistentScrollGridPanel', {
extend: 'Ext.grid.Panel',


viewConfig: {
preserveScrollOnRefresh: true
},
});

here is the grid code


var grid = new Ext.create('PersistentScrollGridPanel',{
enableDragDrop: false,
border: false,
title: devicename,
header: false,
rowSelectorDepth: 5,
store: Ext.create('ProcStore', {
baseParams: { device: uid, sort: sort, },
}),
columns: {
defaults: {
width: 40,
sortable: true,
menuDisabled: false,
renderer: qtipRenderer,
},
items: [
{ header: 'User', dataIndex: 'user', width: 60},
...
More headers here
...
],
},
stripeRows: true,
displayTotal: false,
tbar: mytbar
});

Cheers,
Ian

scottmartin
4 Nov 2013, 1:10 PM
I have a grid loading data from a store. There is lots of data


Are you using a buffered store?

Scott.