CellRenderer.getCellIndex()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

componentInstance.getCellIndex()

Parameters

None.

Returns

An object with two fields: columnIndex and itemIndex.

Description

Method; returns an object with two fields, columnIndex and itemIndex, that locate the cell in the component. Each field is an integer that indicates a cell's column position and item position. For any components other than the DataGrid component, the value of columnIndex is always 0.

This method is provided by the List class; you do not have to implement it. Declare it in your cell renderer class as follows, and use it in the functions in your cell renderer:

var getCellIndex:Function;

Example

This example edits a DataGrid component's data provider from within a cell:

var index = getCellIndex();
var colName = listOwner.getColumnAt(index.columnIndex).columnName;
listOwner.dataProvider.editField(index.itemIndex, colName, someVal);