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,

//      Return CSS class to apply to rows depending upon data values
        getRowClass: function(record, index) {
            var c = record.get('change');
            if (c < 0) {
                return 'price-fall';
            } else if (c > 0) {
                return 'price-rise';
            }
        }
    },
    sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
    width:600,
    height:300,
    frame:true,
    title:'Framed with Checkbox Selection and Horizontal Scrolling',
    iconCls:'icon-grid'
});
Notes:

Config Options

Config Options Defined By
  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
  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.Buttons or 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
  deferRowRender : Boolean
True to enable deferred row rendering. Default is true.
GridPanel
  disableSelection : Boolean
True to disable selections in the grid (defaults to false). - ignored if a SelectionModel is specified
GridPanel
  disabled : Boolean
Render this component disabled (default is false).
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
  enableHdMenu : Boolean
True to enable the drop down button for menu in the headers.
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
  hidden : Boolean
Render this component hidden (default is false).
Component
  hideCollapseTool : Boolean
True to hide the expand/collapse toggle button when collapsible = true, false to display it (defaults to false).
Panel
  hideHeaders : Boolean
True to hide the grid's header (defaults to false).
GridPanel
  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
  pageX : Number
The page level x coordinate for this component if contained within a positioning container.
BoxComponent
  pageY : Number
The page level y coordinate for this component if contained within a positioning container.
BoxComponent
  sm : Object
Shorthand for selModel.
GridPanel
  store : Ext.data.Store
The Ext.data.Store the grid should use as its data source (required).
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
  x : Number
The local x (left) coordinate for this component if contained within a positioning container.
BoxComponent
  y : Number
The local y (top) coordinate for this component if contained within a positioning container.
BoxComponent

Public Properties

Property Defined By
  buttons : Array
This Panel's Array of buttons as created from the buttons config property. Read only.
Panel
  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
  rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

Method Defined By

Public Events

Event Defined By