Caplin Trader 5.1.0

Interface: module:ct-grid/GridViewListener

module:ct-grid/GridViewListener

Interface implemented by classes wishing to listen to state events on the grid view. Classes that are interested in listening to these events can subscribe to them via module:ct-grid/GridView#addGridViewListener, and can then later be removed via module:ct-grid/GridView#removeGridViewListener. Classes that wish to provide an implementation of a GridViewListener must implement this interface.

Methods

onActivate()

Called when the view becomes the actively selected component.

onAllRowsReceived()

This call-back is invoked when all outstanding row data has been received.

The firing of this call-back corresponds to the firing of the module:ct-grid/GridRowModelListener#onAllDataReceived method on the underlying module:ct-grid/GridRowModel, but additionally occurs after all row rendering for these updates has taken place.

onClose()

Called when the view is closed. Arguments are possible.

onContainerHtmlRendered()

Called when the grid view has rendered some container html — everything but the row data.

This call occurs as soon the view is made aware of the number of rows available within its underlying module:ct-grid/GridRowModel (via module:ct-grid/GridRowModelListener#onSizeChanged).

onDeactivate()

Called when the view ceases to be the actively selected component.

onHide()

Called when the view is hidden. Arguments are possible.

onMaximize()

Called when the view is maximised. Arguments are possible.

onMinimize()

Called when the view is minimised. Arguments are possible.

onOpen(nWidth, nHeight)

Called when the view is opened. Arguments are possible.

Parameters:
Name Type Description
nWidth int

the width of the grid.

nHeight int

the height of the grid.

onResize(nWidth, nHeight)

Called when the grid is resized.

Parameters:
Name Type Description
nWidth int

The width of the resized grid.

nHeight int

The height of the resized grid.

onRestore()

Called when the view is restored. Arguments are possible.

onScroll(nScrollAmount, nPreviousStartIndex)

Optional. Called when the view is scrolled.

Parameters:
Name Type Description
nScrollAmount int

the total height in pixels from the start index.

nPreviousStartIndex int

the index of the first visible row from the last load.

onScrollComplete()

Called when the view is scrolled. implement module:ct-grid/GridView#onScrollVertical or implement module:ct-grid/GridView#onScrollHorizontal instead

Deprecated:
  • Yes

onScrollHorizontal(nScroll)

Called when the view is scrolled horizontally.

Parameters:
Name Type Description
nScroll int

new horizontal offset

onScrollVertical(nScrollAmount, nNewStartIndex)

Called when the view is scrolled vertically.

Parameters:
Name Type Description
nScrollAmount int

the number of rows the view has been moved by (a positive number if the grid has scrolled down, and a negative number if the grid has been scrolled up)

nNewStartIndex int

the new index of the first visible row

onShow()

Called when the view is shown. Arguments are possible.

onViewRedrawn(pIndices)

This call-back is invoked when a change occurs that requires the view HTML to be redrawn. For example, when a grid is resized or when a set of child rows in an expandable grid are opened or closed.

Decorators whose changes may be destroyed by a large scale redraw of the view can use this call-back method to re-apply any changes they've made.

Parameters:
Name Type Description
pIndices Array

The list of row indices for which the subject has changed.

onVisibleRowCountChanged(nOldRowCount, nNewRowCount)

Called when the grid is resized, so that there more or less rows than before.

Parameters:
Name Type Description
nOldRowCount int

the number of rows before the resize

nNewRowCount int

the number of rows after the resize