Extjs gridpanel doesn't expand horizontally within a tabPanel

josh picture josh · Nov 12, 2009 · Viewed 13.9k times · Source

Each of my 3 Extjs gridpanels do not expand horizontally within a tabPanel.

The each grid's properties:

  id: grid_id,
  ds: ds,
  cm: cm,
  loadMask:      true,
  view:          grouping_view,
  plugins:       [expander, filters],
  stateId:       which + '-grid-stateId',
  stateful:      true,
  stateEvents:   ['datachanged', 'columnresize', 'columnmove', 'sortchange', 'columnvisible', 'columnsort', 'hide', 'show', 'expand', 'collapse'],
  selModel:      checkbox,
  // height:        400,
  width:         GRID_WIDTH,
  defaults:      {autoHeight: true},
  autoHeight:    true,
  collapsible:   false,
  animCollapse:  false,
  layout:        'fit',

TabPanel's properties:

  id:         'tab_panel',
  renderTo:   'tabs',
  activeTab:  0,
  enableTabScroll:  true,
  defaults:   {autoScroll:true, authHeight:true},
  plugins:    new Ext.ux.TabCloseMenu(),
  width:      GRID_WIDTH + 2,
  autoHeight: true,
  items: [       // put items in tabpanel like this. adding via method call forces them to render/load befire user clicks on them
     owned_grid,
     managed_grid,
     subscribed_grid
  ],

Answer

Jason picture Jason · Nov 12, 2009

Layout is not a valid property for a GridPanel.

Try using:

viewConfig: { forceFit: true }

instead