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
| Name | Type | Optional | Default | Descripton |
oData | Object | The data describing the cell. This is by default displayed as text on the cell. |
Properties
| Name | Type | get | set | Descripton |
backColor | String | ![]() | ![]() | The background color name |
bold | Boolean | ![]() | ![]() | Whether the font of the cell should be bold or not. |
columnIndex | Number | ![]() | The column index of the cell | |
created | Boolean | ![]() | This 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. | |
cssClassName | String | ![]() | Returns the CSS class name used for the cell. | |
data | Object | ![]() | ![]() | The data associated with the cell |
foreColor | String | ![]() | ![]() | The foreground color name |
grid | | ![]() | Returns the grid component that the cell is part of | |
height | Number | ![]() | Returns the height of the cell. | |
html | String | ![]() | Returns the HTML for the cell. This is used by the BiAbstractGrid gridBodyHtml property when drawing the grid. | |
icon | | ![]() | Returns the icon for the row. If you need different icons for different cells you should override this getter. | |
iconHtml | String | ![]() | Returns the HTML used to draw the icon. | |
labelHtml | String | ![]() | Returns the actual HTML to show on the cell. Override this to handle specific data. The default implementation uses String(cell.getData()) | |
left | Number | ![]() | Returns the left position relative to the grid. | |
row | | ![]() | The row that the cell is part of | |
rowIndex | Number | ![]() | The index of the row that the cell is part of | |
selected | Boolean | ![]() | ![]() | Whether the cell is selected or not. This should not be set when the selection mode for the grid is set to row selection. |
top | Number | ![]() | Returns the top position relative to the grid. | |
width | Number | ![]() | Returns the width of the cell. |
Methods
| Name | Description |
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. |
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. |
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. |
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. |
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. |
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
| Name | Type | Optional | Default | Descripton |
bTopLeft | Boolean | ![]() | null | 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
| Name | Type | Optional | Default | Descripton |
bLeft | Boolean | ![]() | null | 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
| Name | Type | Optional | Default | Descripton |
bTop | Boolean | ![]() | null | 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
