Properties Methods Events Config Options Direct Link
Observable
  Component
    BoxComponent
      Container
        Panel
          GridPanel

Class Ext.grid.GridPanel

Package:Ext.grid
Defined In:GridPanel.js
Class:GridPanel
Subclasses:EditorGridPanel
Extends:Panel
This class represents the primary interface of a component based grid control.

Usage:
var grid = new Ext.grid.GridPanel({
    store: new Ext.data.Store({
        reader: reader,
        data: xg.dummyData
    }),
    columns: [
        {id:'company', header: "Company", width: 200, sortable: true, dataIndex: 'company'},
        {header: "Price", width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
        {header: "Change", width: 120, sortable: true, dataIndex: 'change'},
        {header: "% Change", width: 120, sortable: true, dataIndex: 'pctChange'},
        {header: "Last Updated", width: 135, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
    ],
    viewConfig: {
        forceFit: true
    },
    sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
    width:600,
    height:300,
    frame:true,
    title:'Framed with Checkbox Selection and Horizontal Scrolling',
    iconCls:'icon-grid'
});
Note: Although this class inherits many configuration options from base classes, some of them (such as autoScroll, layout, items, etc) won't function as they do with the base Panel class.

To access the data in a Grid, it is necessary to use the data model encapsulated by the Store. See the cellclick event.

Config Options

Config Options Defined By
  allowDomMove : Boolean
Whether the component can move the Dom node when rendering (defaults to true).
Component
  autoExpandColumn : String
The id of a column in this grid that should expand to fill unused space. This id can not be 0.
GridPanel
  autoExpandMax : Number
The maximum width the autoExpandColumn can have (if enabled). Defaults to 1000.
GridPanel
  autoExpandMin : Number
The minimum width the autoExpandColumn can have (if enabled). defaults to 50.
GridPanel
  autoHeight : Boolean
True to use height:'auto', false to use fixed height (defaults to false).
BoxComponent
  autoWidth : Boolean
True to use width:'auto', false to use fixed width (defaults to false).
BoxComponent
  baseCls : String
The base CSS class to apply to this panel's element (defaults to 'x-panel').
Panel
  buttonAlign : String
The alignment of any buttons added to this panel. Valid values are 'right,' 'left' and 'center' (defaults to 'right').
Panel
  buttons : Array
An array of Ext.Button configs used to add buttons to the footer of this panel.
Panel
  cm : Object
Shorthand for colModel.
GridPanel
  colModel : Object
The Ext.grid.ColumnModel to use when rendering the grid (required).
GridPanel
  collapsed : Boolean
True to render the panel collapsed, false to render it expanded (defaults to false).
Panel
  collapsedCls : String
A CSS class to add to the panel's element after it has been collapsed (defaults to 'x-panel-collapsed').
Panel
  columns : Array
An array of columns to auto create a ColumnModel
GridPanel
  contentEl : String
The id of an existing HTML node to use as the panel's body content (defaults to '').
Panel
  defaultType : String
The default type of container represented by this object as registered in Ext.ComponentMgr (defaults to 'panel').
Container
  disableSelection : Boolean
True to disable selections in the grid (defaults to false). - ignored a SelectionModel is specified
GridPanel
  disabledClass : String
CSS class added to the component when it is disabled (defaults to "x-item-disabled").
Component
  enableColumnHide : Boolean
True to enable hiding of columns with the header context menu.
GridPanel
  enableColumnMove : Boolean
True to enable drag and drop reorder of columns.
GridPanel
  enableColumnResize : Boolean
False to turn off column resizing for the whole grid (defaults to true).
GridPanel
  enableDragDrop : Boolean
True to enable drag and drop of rows.
GridPanel
  enableHdMenu : Boolean
True to enable the drop down button for menu in the headers.
GridPanel
  enableRowHeightSync : Boolean
True to manually sync row heights across locked and not locked rows.
GridPanel
  frame : Boolean
True to render the panel with custom rounded borders, false to render with plain 1px square borders (defaults to false).
Panel
  headerAsText : Boolean
True to display the panel title in the header, false to hide it (defaults to true).
Panel
  height : Number
The height of this component in pixels (defaults to auto).
BoxComponent
  hideCollapseTool : Boolean
True to hide the expand/collapse toggle button when collapsible = true, false to display it (defaults to false).
Panel
  html : String/Object
An HTML fragment, or a DomHelper specification to use as the panel's body content (defaults to '').
Panel
  iconCls : String
A CSS class that will provide a background image to be used as the panel header icon (defaults to '').
Panel
  id : String
The unique id of this component (defaults to an auto-assigned id).
Component
  loadMask : Object
An Ext.LoadMask config or true to mask the grid while loading (defaults to false).
GridPanel
  maxHeight : Number
Sets the maximum height of the grid - ignored if autoHeight is not on.
GridPanel
  minButtonWidth : Number
Minimum width in pixels of all buttons in this panel (defaults to 75)
Panel
  minColumnWidth : Number
The minimum width a column can be resized to. Defaults to 25.
GridPanel
  monitorWindowResize : Boolean
True to autoSize the grid when the window resizes. Defaults to true.
GridPanel
  sm : Object
Shorthand for selModel.
GridPanel
  stateId : String
The unique id for this component to use for state management purposes (defaults to the component id).
Component
  store : Ext.data.Store
The Ext.data.Store the grid should use as its data source (required).
GridPanel
  stripeRows : Boolean
True to stripe the rows. Default is false.
GridPanel
  trackMouseOver : Boolean
True to highlight rows when the mouse is over. Default is true.
GridPanel
  view : Object
The Ext.grid.GridView used by the grid. This can be set before a call to render().
GridPanel
  width : Number
The width of this component in pixels (defaults to auto).
BoxComponent

Public Properties

Property Defined By
  buttons : Array
This Panel's Array of buttons as created from the buttons config property. Read only.
Panel
  disabled : Boolean
True if this component is disabled. Read-only.
Component
  footer : Ext.Element
The Panel's footer Element. Read-only.

This Element is used to house the Panel's buttons.

Panel
  header : Ext.Element
The Panel's header Element. Read-only.

This Element is used to house the title and tools

Panel
  hidden : Boolean
True if this component is hidden. Read-only.
Component
  initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
  items : MixedCollection
The collection of components in this container as a Ext.util.MixedCollection
Container
  rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

Method Defined By

Public Events

Event Defined By