9
votes

I am using Ext.grid.GridPanel in Extjs 4.

Autoscroll is not working in my GridPanel.

How can I resolve this?

3
I don't think we can guess what code you have, so we are unlikely to know how to fix your bug.Mat
autoScroll:true (scrollbars) is not working, auto scrolling to a focused record is not working, or scroll to a selected row using mind control is not working? :pLionel Chan

3 Answers

14
votes

Put below config in your parent container of GridPanel.

   layout: 'fit'

And remove autoScroll from GridPanel.

0
votes
scroll: true,
  viewConfig: {
    style: {
      overflow: 'auto',
        overflowX: 'hidden'
    }
  },

Try the above config option. This also will solve your problem.

0
votes

If the parent container needs to use some other layout other than 'fit', as suggested by previous comments, you could try this: set the height of the grid once the store loads. Moreover, instead of having to calculate the actual height, this may do the trick:

grid.setHeight('100%')

According to documentation, setHeight can accept "A String used to set the CSS height style."