Results 1 to 2 of 2

Thread: preserveScrollOnRefresh: true - working for rows in grid but not headers

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    3
    Vote Rating
    0
      0  

    Default preserveScrollOnRefresh: true - working for rows in grid but not headers

    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 ?

    Code:
    Ext.define('PersistentScrollGridPanel', {            
               extend: 'Ext.grid.Panel',
    
    
                viewConfig: {
                    preserveScrollOnRefresh: true
                },
            });
    here is the grid code

    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

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    I have a grid loading data from a store. There is lots of data
    Are you using a buffered store?

    Scott.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •