Print Friendly

# Class Ext.grid.GridView

Package: | Ext.grid
Class: | GridView
Extends: | AbstractGridView
Defined In: | GridView.js

The default GridView implementation
Properties - Methods - Events

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| GridView(`Object config`) | GridView
| autoSizeColumn(`Number colIndex`, `Boolean forceMinSize`) : void | GridView
Autofit a column to its content.
| autoSizeColumns() : void | GridView
Autofits all columns to their content and then expands to fit any extra space in the grid
| ensureVisible(`Number row`, `Number col`, `Boolean hscroll`) : void | GridView
Scrolls the specified cell into view
| fitColumns(`Boolean reserveScrollSpace`) : void | GridView
Autofits all columns to the grid's width proportionate with their current size
| focusCell(`Number row`, `Number col`, `Boolean hscroll`) : void | GridView
Focuses the specified cell.
| focusRow(`Number row`) : void | GridView
Focuses the specified row.
| getFooterPanel(`Boolean doShow`) : Ext.Element | GridView
Gets a panel in the footer of the grid that can be used for toolbars etc. After modifying the contents of this panel ...
| getHeaderPanel(`Boolean doShow`) : Ext.Element | GridView
Gets a panel in the header of the grid that can be used for toolbars etc. After modifying the contents of this panel ...
| getRowClass(`Record record`, `Number index`) : void | GridView
Override this function to apply custom css classes to rows during rendering
| refresh(`Boolean headersToo`) : void | GridView
Refreshes the grid
| scrollToTop() : void | GridView
Scrolls the grid to the top

## Public Events

This class has no public events.

## Constructor Details

### GridView

`public function GridView(`Object config`)`
Parameters:

- `config` : Object

## Method Details

### autoSizeColumn

`public function autoSizeColumn(`Number colIndex`, `Boolean forceMinSize`)`
Autofit a column to its content.
Parameters:

- `colIndex` : Number
- `forceMinSize` : Boolean
  true to force the column to go smaller if possible

Returns:

- `void`

This method is defined by GridView.

### autoSizeColumns

`public function autoSizeColumns()`
Autofits all columns to their content and then expands to fit any extra space in the grid
Parameters:

- None.

Returns:

- `void`

This method is defined by GridView.

### ensureVisible

`public function ensureVisible(`Number row`, `Number col`, `Boolean hscroll`)`
Scrolls the specified cell into view
Parameters:

- `row` : Number
  The row index
- `col` : Number
  The column index
- `hscroll` : Boolean
  false to disable horizontal scrolling

Returns:

- `void`

This method is defined by GridView.

### fitColumns

`public function fitColumns(`Boolean reserveScrollSpace`)`
Autofits all columns to the grid's width proportionate with their current size
Parameters:

- `reserveScrollSpace` : Boolean
  Reserve space for a scrollbar

Returns:

- `void`

This method is defined by GridView.

### focusCell

`public function focusCell(`Number row`, `Number col`, `Boolean hscroll`)`
Focuses the specified cell.
Parameters:

- `row` : Number
  The row index
- `col` : Number
  The column index
- `hscroll` : Boolean
  false to disable horizontal scrolling

Returns:

- `void`

This method is defined by GridView.

### focusRow

`public function focusRow(`Number row`)`
Focuses the specified row.
Parameters:

- `row` : Number
  The row index

Returns:

- `void`

This method is defined by GridView.

### getFooterPanel

`public function getFooterPanel(`Boolean doShow`)`
Gets a panel in the footer of the grid that can be used for toolbars etc. After modifying the contents of this panel a call to grid.autoSize() may be required to register any changes in size.
Parameters:

- `doShow` : Boolean
  By default the footer is hidden. Pass true to show the panel

Returns:

- `Ext.Element`

This method is defined by GridView.

### getHeaderPanel

`public function getHeaderPanel(`Boolean doShow`)`
Gets a panel in the header of the grid that can be used for toolbars etc. After modifying the contents of this panel a call to grid.autoSize() may be required to register any changes in size.
Parameters:

- `doShow` : Boolean
  By default the header is hidden. Pass true to show the panel

Returns:

- `Ext.Element`

This method is defined by GridView.

### getRowClass

`public function getRowClass(`Record record`, `Number index`)`
Override this function to apply custom css classes to rows during rendering
Parameters:

- `record` : Record
  The record
- `index` : Number

Returns:

- `void`

This method is defined by GridView.

### refresh

`public function refresh(`Boolean headersToo`)`
Refreshes the grid
Parameters:

- `headersToo` : Boolean

Returns:

- `void`

This method is defined by GridView.

### scrollToTop

`public function scrollToTop()`
Scrolls the grid to the top
Parameters:

- None.

Returns:

- `void`

This method is defined by GridView.

Ext - Copyright © 2006-2007 Ext JS, LLC
All rights reserved.