PDA

View Full Version : Detect if vertical scrollbar is shown in Panel.



ZyBeR
28 Jul 2013, 5:45 AM
Is there any way of checking if a vertical scrollbar is shown in a Panel?

Unfortunately the getWidth() method don't take the scrollbar in consideration, so I need to check if one is shown and the subtract it's width from the panels width to get a correct available width measurement.

ZyBeR
28 Jul 2013, 11:43 PM
Found a solution.


if (Ext.getCmp('obj').body.dom.scrollHeight > Ext.getCmp('obj').getHeight()) {
// Scrollbar ON
} else {
// Scrollbar OFF
}