BiGridCell

This class represents a cell in a grid row.

This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiGridCell .

Constructor

new BiGridCell ( oData )

Parameters

NameTypeOptionalDefaultDescripton
oDataObjectThe data describing the cell. This is by default displayed as text on the cell.

Properties

NameTypegetsetDescripton
backColorStringcheckedcheckedThe background color name
boldBooleancheckedcheckedWhether the font of the cell should be bold or not.
columnIndexNumbercheckedThe column index of the cell
createdBooleancheckedThis is true when the cell has been drawn and has a visual representation. For this to be true the grid must have been created and drawn.
cssClassNameStringcheckedReturns the CSS class name used for the cell.
dataObjectcheckedcheckedThe data associated with the cell
foreColorStringcheckedcheckedThe foreground color name
gridBiGridcheckedReturns the grid component that the cell is part of
heightNumbercheckedReturns the height of the cell.
htmlStringcheckedReturns the HTML for the cell. This is used by the BiAbstractGrid gridBodyHtml property when drawing the grid.
iconBiImagecheckedReturns the icon for the row. If you need different icons for different cells you should override this getter.
iconHtmlStringcheckedReturns the HTML used to draw the icon.
labelHtmlStringcheckedReturns the actual HTML to show on the cell. Override this to handle specific data. The default implementation uses String(cell.getData())
leftNumbercheckedReturns the left position relative to the grid.
rowBiGridRowcheckedThe row that the cell is part of
rowIndexNumbercheckedThe index of the row that the cell is part of
selectedBooleancheckedcheckedWhether the cell is selected or not. This should not be set when the selection mode for the grid is set to row selection.
topNumbercheckedReturns the top position relative to the grid.
widthNumbercheckedReturns the width of the cell.

Methods

NameDescription
isIconCellReturns true when the cell should display an icon. This asks the grid for the icon column to decide whether this cell should show the icon.
scrollIntoViewScrolls the grid component viewport so that the cell becomes visible inside the viewport if possible. The argument can be used to tell what edge of the viewport the cell should be aligned to.
scrollIntoViewXScrolls the grid component viewport horizontally so that the cell becomes visible inside the viewport if possible. The argument can be used to tell what edge of the viewport the cell should be aligned to.
scrollIntoViewYScrolls the grid component viewport vertically so that the cell becomes visible inside the viewport if possible. The argument can be used to tell what edge of the viewport the cell should be aligned to.
updateUpdates the cell. This allows the grid to redraw only the current cell of the grid. This is useful when only a few items have changed and therefore the whole data of the grid does not need to be redrawn.

Events

None.

Static Methods

None.

Static Fields

None.

Remarks

To change the way the cell is displayed after the grid is drawn use the update method. To change the way the cell displays the data override the labelHtml getter.

Method Details

isIconCell

Returns true when the cell should display an icon. This asks the grid for the icon column to decide whether this cell should show the icon.

Syntax

object.isIconCell ( )

Parameters

No arguments.

Return Type

Boolean

scrollIntoView

Scrolls the grid component viewport so that the cell becomes visible inside the viewport if possible. The argument can be used to tell what edge of the viewport the cell should be aligned to.

Syntax

object.scrollIntoView ( [ bTopLeft ] )

Parameters

NameTypeOptionalDefaultDescripton
bTopLeftBooleancheckednull This describes the value to align the cell to relative to the viewport of the grid.

null - Scroll as little as possible to make the cell visible in the parent viewport.
true - try to align the cell with the upper left edge of the grid viewport.
false - try to align the cell with the lower right edge of the grid viewport.

Return Type

void

scrollIntoViewX

Scrolls the grid component viewport horizontally so that the cell becomes visible inside the viewport if possible. The argument can be used to tell what edge of the viewport the cell should be aligned to.

Syntax

object.scrollIntoViewX ( [ bLeft ] )

Parameters

NameTypeOptionalDefaultDescripton
bLeftBooleancheckednull This describes the value to align the cell to relative to the viewport of the grid.

null - Scroll as little as possible to make the cell visible in the parent viewport.
true - try to align the cell with the left edge of the grid viewport.
false - try to align the cell with the right edge of the grid viewport.

Return Type

void

scrollIntoViewY

Scrolls the grid component viewport vertically so that the cell becomes visible inside the viewport if possible. The argument can be used to tell what edge of the viewport the cell should be aligned to.

Syntax

object.scrollIntoViewY ( [ bTop ] )

Parameters

NameTypeOptionalDefaultDescripton
bTopBooleancheckednull This describes the value to align the cell to relative to the viewport of the grid.

null - Scroll as little as possible to make the cell visible in the parent viewport.
true - try to align the cell with the upper edge of the grid viewport.
false - try to align the cell with the lower edge of the grid viewport.

Return Type

void

update

Updates the cell. This allows the grid to redraw only the current cell of the grid. This is useful when only a few items have changed and therefore the whole data of the grid does not need to be redrawn.

Syntax

object.update ( )

Parameters

No arguments.

Return Type

void