Extjs 4 Grid autoScroll
Asked Answered
A

3

9

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

Autoscroll is not working in my GridPanel.

How can I resolve this?

Axenic answered 26/7, 2011 at 19:43 Comment(2)
I don't think we can guess what code you have, so we are unlikely to know how to fix your bug.Ramsey
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? :pAntonetteantoni
C
14

Put below config in your parent container of GridPanel.

   layout: 'fit'

And remove autoScroll from GridPanel.

Convector answered 29/7, 2011 at 11:11 Comment(3)
I have been spinning my wheels on this all day. Thank you!Endothermic
the issue is/was the autoScroll option sets overflow to auto, but no height is specified. So you either have to set a height to the container/grid or pick a parent layout that sets the height for you. In most cases the layout: 'fit' is most suited. +1 for @ConvectorLutes
Had the same problem with version 6.1 and that trick fixed it perfectly !Terryn
T
0
scroll: true,
  viewConfig: {
    style: {
      overflow: 'auto',
        overflowX: 'hidden'
    }
  },

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

Twayblade answered 19/8, 2016 at 13:33 Comment(0)
O
0

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."

Orizaba answered 18/7, 2019 at 6:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.