BiTreeViewViewManager

This class handles the visual properties of a BiTreeView

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

Constructor

new BiTreeViewViewManager ( [ oTreeView ] )

Parameters

NameTypeOptionalDefaultDescripton
oTreeViewBiTreeViewcheckedThe tree view this view manager is to be used with

Properties

NameTypegetsetDescripton
ascendingIconStringcheckedcheckedThe path to the arrow image to use for ascending sort
cellPaddingXNumbercheckedThis returns the amount of padding to take into account when sizing the cells This returns different values depending on the user agent.
columnCountNumbercheckedThe number of columns to show
columnOrdersNumber[]checkedcheckedThe order of the columns in the visual representation
dataModelBiTreeViewDataModelcheckedThe data model that is used with the tree view
descendingIconStringcheckedcheckedThe path to the arrow image to use for descending sort
firstVisibleColumnNumbercheckedThe first visible column in the tree view viewport
firstVisibleRowNumbercheckedThe first shown row in the viewport
headerCellPaddingXNumbercheckedThis returns the amount of padding to take into account when sizing the header cells This returns different values depending on the user agent.
headersHeightNumbercheckedcheckedThe height of the column headers
highlightSortColumnBooleancheckedcheckedWhether to highlight the background of the sorted column
indentColumnNumbercheckedcheckedThe index of the column that should be indented. Use -1 to not show any indention
pageCountNumbercheckedThe number of rows shown in the viewport
rowHeadersWidthNumbercheckedcheckedThe width of the row headers
rowHeightNumbercheckedcheckedThe height of a row in the tree view
scrollLeftNumbercheckedSets the scroll left to the view manager so that the view manager can figure out what column to start at
scrollTopNumbercheckedSets the scroll top to the view manager so that the view manager can figure out what row to start at
showGridLinesBooleancheckedcheckedWhether to show grid lines between the cells in the tree view
showHeadersBooleancheckedcheckedWhether to show the headers
shownColumnsWidthNumbercheckedThis is the sum of all the column widths
showRowHeadersBooleancheckedcheckedWhether to show the row headers
treeViewBiTreeViewcheckedcheckedThe tree view this view manager is to be used with

Methods

NameDescription
fitColumnWidthsResizes all columns to fit inside the grid.
getCanMoveColumnWhether the user can drag the column header to reorder the columns
getCanResizeColumnWhether the column at x can be resize
getCellBoundsReturns the boundaries for the cell. This returns an object with left, top width and height fields describing the boundaries.
getCellHeightReturns the row height for the row. For a BiTreeView this should be the same for all rows.
getCellWidthReturns the width for a column. (Same as getColumnWidth)
getColumnAtReturns the column at the x position. x is the distance from the left edge (if row headers visible left edge is to the left edge of the row headers
getColumnBoundsReturns the boundaries for the column. This returns an object with left, top width and height fields describing the boundaries.
getColumnLeftReturns the left position for the column.
getColumnWidthThis returns the width of the xth column
getColumnVisibleWhether the column at x is visible or hidden
getHeaderBoundsReturns the boundaries for the header. This returns an object with left, top width and height fields describing the boundaries.
getModelColumnReturns the column index in the data model for the visual column index
getNextColumnReturns the index of the column coming after the given column
getPreviousColumnReturns the index of the column coming before the given column
getRowAtReturns the row at the y position. y is the distance from the upper edge in pixels
getRowBoundsReturns the boundaries for the row. This returns an object with left, top width and height fields describing the boundaries.
getShowExpandIconWhether to show the expand icon (plus/minus icon) for the given row
getViewColumnReturns the visual column index for the index in the data model
insertColumnBeforeInserts a column before another column
resetCacheResets the cached properties. This is called after the columns are changed
rowCountChangedThis is called when the row count changes.
scrollCellIntoViewScrolls the tree view so that the given cell becomes visible
scrollColumnIntoViewScrolls the tree view so that the given column becomes visible
scrollRowIntoViewScrolls the tree view so that the given row becomes visible
scrollSubtreeIntoViewScrolls a subtree into view (if possible)
setColumnWidthSets the width of the xth column
setColumnVisibleSets whether a column should be visible or not

Events

None.

Static Methods

None.

Static Fields

None.

Remarks

None.

Method Details

fitColumnWidths

Resizes all columns to fit inside the grid.

Syntax

object.fitColumnWidths ( )

Parameters

No arguments.

Return Type

void

getCanMoveColumn

Whether the user can drag the column header to reorder the columns

Syntax

object.getCanMoveColumn ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column

Return Type

Boolean

getCanResizeColumn

Whether the column at x can be resize

Syntax

object.getCanResizeColumn ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column

Return Type

Boolean

getCellBounds

Returns the boundaries for the cell. This returns an object with left, top width and height fields describing the boundaries.

Syntax

object.getCellBounds ( x,y )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column index of the cell
yNumberThe row index of the cell

Return Type

Object

getCellHeight

Returns the row height for the row. For a BiTreeView this should be the same for all rows.

Syntax

object.getCellHeight ( y )

Parameters

NameTypeOptionalDefaultDescripton
yNumberThe row to get the height for

Return Type

Number

getCellWidth

Returns the width for a column. (Same as getColumnWidth)

Syntax

object.getCellWidth ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column to get the width for

Return Type

Number

getColumnAt

Returns the column at the x position. x is the distance from the left edge (if row headers visible left edge is to the left edge of the row headers

Syntax

object.getColumnAt ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe distance (in pixels) from the left edge.

Return Type

Number

getColumnBounds

Returns the boundaries for the column. This returns an object with left, top width and height fields describing the boundaries.

Syntax

object.getColumnBounds ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column

Return Type

Object

getColumnLeft

Returns the left position for the column.

Syntax

object.getColumnLeft ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column

Return Type

Number

getColumnWidth

This returns the width of the xth column

Syntax

object.getColumnWidth ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column to get the width for

Return Type

Number

getColumnVisible

Whether the column at x is visible or hidden

Syntax

object.getColumnVisible ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column index

Return Type

Boolean

getHeaderBounds

Returns the boundaries for the header. This returns an object with left, top width and height fields describing the boundaries.

Syntax

object.getHeaderBounds ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column index of the header cell

Return Type

Object

getModelColumn

Returns the column index in the data model for the visual column index

Syntax

object.getModelColumn ( vx )

Parameters

NameTypeOptionalDefaultDescripton
vxNumberThe visual column index

Return Type

Number

getNextColumn

Returns the index of the column coming after the given column

Syntax

object.getNextColumn ( mx )

Parameters

NameTypeOptionalDefaultDescripton
mxNumberThe index of the column

Return Type

Number

getPreviousColumn

Returns the index of the column coming before the given column

Syntax

object.getPreviousColumn ( mx )

Parameters

NameTypeOptionalDefaultDescripton
mxNumberThe index of the column

Return Type

Number

getRowAt

Returns the row at the y position. y is the distance from the upper edge in pixels

Syntax

object.getRowAt ( y )

Parameters

NameTypeOptionalDefaultDescripton
yNumberThe distance (in pixels) from the upper edge.

Return Type

Number

getRowBounds

Returns the boundaries for the row. This returns an object with left, top width and height fields describing the boundaries.

Syntax

object.getRowBounds ( y )

Parameters

NameTypeOptionalDefaultDescripton
yNumberThe index of the row

Return Type

Object

getShowExpandIcon

Whether to show the expand icon (plus/minus icon) for the given row

Syntax

object.getShowExpandIcon ( y )

Parameters

NameTypeOptionalDefaultDescripton
yNumberThe row index

Return Type

Boolean

getViewColumn

Returns the visual column index for the index in the data model

Syntax

object.getViewColumn ( mx )

Parameters

NameTypeOptionalDefaultDescripton
mxNumberThe index in the data model

Return Type

Number

insertColumnBefore

Inserts a column before another column

Syntax

object.insertColumnBefore ( x,beforeX )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column to insert
beforeXNumberThe index of the column to insert before

Return Type

void

resetCache

Resets the cached properties. This is called after the columns are changed

Syntax

object.resetCache ( )

Parameters

No arguments.

Return Type

void

rowCountChanged

This is called when the row count changes.

Syntax

object.rowCountChanged ( nRow,nCount )

Parameters

NameTypeOptionalDefaultDescripton
nRowNumberThe row that change starts at
nCountNumberThe rows that was added or removed

Return Type

void

scrollCellIntoView

Scrolls the tree view so that the given cell becomes visible

Syntax

object.scrollCellIntoView ( x,y )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column index of the cell to scroll into view
yNumberThe row index of the cell to scroll into view

Return Type

void

scrollColumnIntoView

Scrolls the tree view so that the given column becomes visible

Syntax

object.scrollColumnIntoView ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column to scroll into view

Return Type

void

scrollRowIntoView

Scrolls the tree view so that the given row becomes visible

Syntax

object.scrollRowIntoView ( y )

Parameters

NameTypeOptionalDefaultDescripton
yNumberThe index of the row to scroll into view

Return Type

void

scrollSubtreeIntoView

Scrolls a subtree into view (if possible)

Syntax

object.scrollSubtreeIntoView ( y )

Parameters

NameTypeOptionalDefaultDescripton
yNumberThe row index of the row whos subtree should be scrolled into view

Return Type

void

setColumnWidth

Sets the width of the xth column

Syntax

object.setColumnWidth ( x,w )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe index of the column to set the width for
wNumberThe new width

Return Type

void

setColumnVisible

Sets whether a column should be visible or not

Syntax

object.setColumnVisible ( x,b )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column index (in the data model) that should be hidden or shown
bBooleabWhether to hide or show the colunm

Return Type

void