Class YAHOO.ext.grid.Grid

Object
   |
   +--YAHOO.ext.grid.Grid

class YAHOO.ext.grid.Grid


This class represents the primary interface of a component based grid control.

Usage:


 var grid = new YAHOO.ext.grid.Grid('my-container-id', dataModel, columnModel);
 // set any options
 grid.render();
 

Defined in Grid.js

Requires:


Field Summary
 Object allowTextSelectionPattern
  A regular expression defining tagNames allowed to have text selection (Defaults to /INPUT|TEXTAREA/i)
 Boolean autoSizeColumns
  True to automatically resize the columns to fit their content on initial render
 Boolean autoSizeHeaders
  True to measure headers with column data when auto sizing columns
 String ddText
  Configures the text is the drag proxy (defaults to "%0 selected row(s)").
 Boolean enableDragDrop
  True to enable drag and drop of rows
 Number maxRowsToMeasure
  If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of rows measured to get a columns size - defaults to 0 (all rows).
 Number minColumnWidth
  The minimum width a column can be resized to.
 Boolean stripeRows
  True to stripe the rows (default is true)
 Boolean trackMouseOver
  True to highlight rows when the mouse is over (default is false)
 
Constructor Summary
YAHOO.ext.grid.Grid (<String/HTMLElement/YAHOO.ext.Element> container, <Object> dataModel, <Object> colModel, <Object> selectionModel)
  
 
Method Summary * Parameter types in italic indicate optional parameters
 void addListener(<String> eventName, <Function> fn, <Object> scope, <boolean> override)
   Adds a listener for one of the many defined grid events
 void autoSize()
   Causes the grid to manually recalculate it's dimensions.
 void bindToField(fieldId)
   Binds this grid to the field with the specified id.
 void clearSelections()
   Convenience method for getSelectionModel().clearSelections() - See YAHOO.ext.grid.DefaultSelectionModel.clearSelections() for more details.
 HTMLElement getCellAfter(<HTMLElement> cell, <Boolean> includeHidden)
   Returns the cell that comes after the specified cell - text nodes are skipped.
 HTMLElement getCellBefore(<HTMLElement> cell, <Boolean> includeHidden)
   Returns the cell that comes before the specified cell - text nodes are skipped.
 HTMLElement getCellFromChild(<HTMLElement> childEl)
   Returns the cell that contains the specified child element.
 Object getColumnModel()
   Returns the grid's ColumnModel.
 Object getDataModel()
   Returns the grid's DataModel.
 String getDragDropText()
   Called to get grid's drag proxy text, by default returns this.ddText.
 HTMLElement getFirstCell(<HTMLElement> row, <Boolean> includeHidden)
   Returns the first cell for the row - text nodes and hidden columns are skipped.
 HTMLElement getHeaderFromChild(<HTMLElement> childEl)
   Returns the header element that contains the specified child element.
 HTMLElement getLastCell(<HTMLElement> row, <Boolean> includeHidden)
   Returns the last cell for the row - text nodes and hidden columns are skipped.
 HTMLElement getRow(index)
   Returns the table row at the specified index
 HTMLElement getRowAfter(<HTMLElement> row)
   Returns the row that comes after the specified row - text nodes are skipped.
 HTMLElement getRowBefore(<HTMLElement> row)
   Returns the row that comes before the specified row - text nodes are skipped.
 HTMLElement getRowFromChild(<HTMLElement> childEl)
   Returns the row that contains the specified child element.
 HtmlElement/Array getRowsById(id)
   Returns the rows that have the specified id(s).
 Object getSelectedRow()
   Convenience method for getSelectionModel().getSelectedRows()[0] - See YAHOO.ext.grid.DefaultSelectionModel.getSelectedRows() for more details.
 Object getSelectedRowId()
   Convenience method for getSelectionModel().getSelectedRowIds()[0] - See YAHOO.ext.grid.DefaultSelectionModel.getSelectedRowIds() for more details.
 Object getSelectedRowIds()
   Convenience method for getSelectionModel().getSelectedRowIds() - See YAHOO.ext.grid.DefaultSelectionModel.getSelectedRowIds() for more details.
 Number getSelectedRowIndex()
   Gets the first selected row or -1 if none are selected
 Array getSelectedRowIndexes()
   Get the selected row indexes
 Object getSelectedRows()
   Convenience method for getSelectionModel().getSelectedRows() - See YAHOO.ext.grid.DefaultSelectionModel.getSelectedRows() for more details.
 Object getSelectionCount()
   Convenience method for getSelectionModel().getCount() - See YAHOO.ext.grid.DefaultSelectionModel.getCount() for more details.
 Object getSelectionModel()
   Returns the grid's SelectionModel.
 Object getView()
   Returns the grid's GridView object.
 Object hasSelection()
   Convenience method for getSelectionModel().hasSelection() - See YAHOO.ext.grid.DefaultSelectionModel.hasSelection() for more details.
 void on(eventName, fn, scope, override)
   Shorthand for addListener
 void readField()
   Causes the grid to read and select the ids from the bound field - See bindToField().
 void removeListener(eventName, fn, scope)
  
 void render()
   Called once after all setup has been completed and the grid is ready to be rendered.
 void scrollTo(<Number/HTMLElement> row)
   Scrolls the grid to the specified row
 void selectAll()
   Convenience method for getSelectionModel().selectAll() - See YAHOO.ext.grid.DefaultSelectionModel.selectAll() for more details.
 void setCellValue(value, rowIndex, colIndex)
  
 void startEditing(rowIndex, colIndex)
   Starts editing the specified for the specified row/column
 void stopEditing()
   Stops any active editing

Field Detail

allowTextSelectionPattern

Object allowTextSelectionPattern

autoSizeColumns

Boolean autoSizeColumns

autoSizeHeaders

Boolean autoSizeHeaders

ddText

String ddText

enableDragDrop

Boolean enableDragDrop

maxRowsToMeasure

Number maxRowsToMeasure

minColumnWidth

Number minColumnWidth

stripeRows

Boolean stripeRows

trackMouseOver

Boolean trackMouseOver

Constructor Detail

YAHOO.ext.grid.Grid

YAHOO.ext.grid.Grid(<String/HTMLElement/YAHOO.ext.Element> container, <Object> dataModel, <Object> colModel, <Object> selectionModel)

Method Detail

addListener

void addListener(<String> eventName, <Function> fn, <Object> scope, <boolean> override)

autoSize

void autoSize()

bindToField

void bindToField(fieldId)

clearSelections

void clearSelections()

getCellAfter

HTMLElement getCellAfter(<HTMLElement> cell, <Boolean> includeHidden)

getCellBefore

HTMLElement getCellBefore(<HTMLElement> cell, <Boolean> includeHidden)

getCellFromChild

HTMLElement getCellFromChild(<HTMLElement> childEl)

getColumnModel

Object getColumnModel()

getDataModel

Object getDataModel()

getDragDropText

String getDragDropText()

getFirstCell

HTMLElement getFirstCell(<HTMLElement> row, <Boolean> includeHidden)

getHeaderFromChild

HTMLElement getHeaderFromChild(<HTMLElement> childEl)

getLastCell

HTMLElement getLastCell(<HTMLElement> row, <Boolean> includeHidden)

getRow

HTMLElement getRow(index)

getRowAfter

HTMLElement getRowAfter(<HTMLElement> row)

getRowBefore

HTMLElement getRowBefore(<HTMLElement> row)

getRowFromChild

HTMLElement getRowFromChild(<HTMLElement> childEl)

getRowsById

HtmlElement/Array getRowsById(id)

getSelectedRow

Object getSelectedRow()

getSelectedRowId

Object getSelectedRowId()

getSelectedRowIds

Object getSelectedRowIds()

getSelectedRowIndex

Number getSelectedRowIndex()

getSelectedRowIndexes

Array getSelectedRowIndexes()

getSelectedRows

Object getSelectedRows()

getSelectionCount

Object getSelectionCount()

getSelectionModel

Object getSelectionModel()

getView

Object getView()

hasSelection

Object hasSelection()

on

void on(eventName, fn, scope, override)

readField

void readField()

removeListener

void removeListener(eventName, fn, scope)

render

void render()

scrollTo

void scrollTo(<Number/HTMLElement> row)

selectAll

void selectAll()

setCellValue

void setCellValue(value, rowIndex, colIndex)

startEditing

void startEditing(rowIndex, colIndex)

stopEditing

void stopEditing()


Documentation generated by JSDoc on Sat Oct 14 06:07:10 2006