0

I have a simple grid developed using ExtJs 4.2.1 framework. The grid is having one bottom bar (bbar). Problem: Horizontal scrollbar is not visible due to the bottom bar (its hidden behind the bottom bar). If I set the height of the grid using grid.setHeight(), I can see the horizontal scroll bar. Is there anyway to tell the grid to adjust its height based on scroll bar visibility?

Earlier I used following code to adjust the height based on scroll bar visibility. But this option is not working in ExtJs 4.2.1.

 if (grid.view.getWidth() < parseFloat(grid.view.getEl().dom.children[0].style.width)) {
        alert('horizontal scroll is present');
  if (grid.view.getHeight() < parseFloat(grid.view.getEl().dom.children[0].scrollHeight)) {
            alert('vertical scroll is present');
    }

Please provide your suggestions.

Thank you

SharpCoder
  • 18,279
  • 43
  • 153
  • 249

2 Answers2

0

you can try autoHeight = true or try the below approach

layout: 'fit', align: 'stretch', items: [{ xtype: 'yourgrid'}]

ie, the containers layout of your grid use fit and align stretch

-1

use autoHeight:true, config in the grid

Surya Prakash Tumma
  • 2,153
  • 4
  • 27
  • 47