Print Friendly

# Class YAHOO.ext.grid.GridView

Package: | YAHOO.ext.grid
Class: | GridView
Extends: | Object
Subclasses: | PagedGridView
Defined In: | GridView.js

Default UI code used internally by the Grid. This is the object returned by YAHOO.ext.grid.Grid.getView.

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| GridView() | GridView
| autoSizeColumn(`Number colIndex`, `Boolean forceMinSize`) : void | GridView
Autofit a column to it's content.
| autoSizeColumns() : void | GridView
Autofits all columns to their content and then expands to fit any extra space in the grid
| ensureVisible(`Number/HTMLElement row`, `Boolean disableDelay`) : void | GridView
Scrolls the specified row into view. This call is automatically buffered (delayed), to disable the delay, pass true f...
| fitColumns() : void | GridView
Autofits all columns to the grid's width proportionate with their current size
| focusRow(`Number/HTMLElement row`) : void | GridView
Focuses the specified row. The preferred way to scroll to a row is ensureVisible.
| getCellAtPoint(`Number x`, `Number y`) : Array | GridView
Returns the rowIndex/columnIndex of the cell found at the passed page coordinates
| setCSSStyle(`Number colIndex`, `String name`, `String value`) : void | GridView
Set a css style for a column dynamically.

## Public Events

This class has no public events.

## Constructor Details

### GridView

`public function GridView()`
Parameters:

- None.

## Method Details

### autoSizeColumn

`public function autoSizeColumn(`Number colIndex`, `Boolean forceMinSize`)`
Autofit a column to it's 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/HTMLElement row`, `Boolean disableDelay`)`
Scrolls the specified row into view. This call is automatically buffered (delayed), to disable the delay, pass true for disableDelay.
Parameters:

- `row` : Number/HTMLElement
  The index of a row or the row itself
- `disableDelay` : Boolean

Returns:

- `void`

This method is defined by GridView.

### fitColumns

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

- None.

Returns:

- `void`

This method is defined by GridView.

### focusRow

`public function focusRow(`Number/HTMLElement row`)`
Focuses the specified row. The preferred way to scroll to a row is ensureVisible.
Parameters:

- `row` : Number/HTMLElement
  The index of a row or the row itself

Returns:

- `void`

This method is defined by GridView.

### getCellAtPoint

`public function getCellAtPoint(`Number x`, `Number y`)`
Returns the rowIndex/columnIndex of the cell found at the passed page coordinates
Parameters:

- `x` : Number
- `y` : Number

Returns:

- `Array`
  [rowIndex, columnIndex]

This method is defined by GridView.

### setCSSStyle

`public function setCSSStyle(`Number colIndex`, `String name`, `String value`)`
Set a css style for a column dynamically.
Parameters:

- `colIndex` : Number
  The index of the column
- `name` : String
  The css property name
- `value` : String
  The css value

Returns:

- `void`

This method is defined by GridView.

Copyright © 2006 Jack Slocum. All rights reserved.