PDA

View Full Version : Detecting scrollbar on a grid panel.



mrtedweb
4 Nov 2012, 5:21 PM
Anyone know how to detect whether or not a grid panel has loaded scrollbars? I added a bottom toolbar containing numerical totals, and the vertical scrollbars are messing up my alignment. It's your basic grid panel, with autoScroll set to true. If I can detect if the grid contains a vertical scrollbar, I can adjust the alignment of the total in the bottom toolbar.

mitchellsimoens
6 Nov 2012, 5:23 AM
You can get the height of the body and el and compare. If the body is larger than the el then it's likely scrollable.

slemmon
6 Nov 2012, 8:45 AM
You might also try using:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-method-isScrollable
(http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-method-isScrollable)
on the grid's view's el.

scottmartin
6 Nov 2012, 3:35 PM
@mrtedweb : answer has been reset.

Scott.