A type alias for the supported column auto resize modes.
A type alias for the data grid copy config.
A type alias for the arguments to a copy format function.
A type alias for a copy format function.
An object which defines the default sizes for a data grid.
A type alias for the supported header visibility modes.
An object which holds the result of a grid hit test.
An object which defines the minimum sizes for a data grid.
An object which defines the style for a data grid.
All style colors support the full CSS color syntax.
Construct a new data grid.
The options for initializing the data grid.
The dataset for the widget's DOM node.
A signal emitted when the widget is disposed.
Set the method for hiding the widget.
Set the id of the widget's DOM node.
Test whether the widget's node is attached to the DOM.
Test whether the widget has been disposed.
Test whether the widget is explicitly hidden.
Test whether the widget is visible.
A widget is visible when it is attached to the DOM, is not explicitly hidden, and has no explicitly hidden ancestors.
Set the layout for the widget.
The layout is single-use only. It cannot be changed after the first assignment.
The layout is disposed automatically when the widget is disposed.
Get the DOM node owned by the widget.
Set the parent of the widget.
Children are typically added to a widget by using a layout, which means user code will not normally set the parent widget directly.
The widget will be automatically removed from its old parent.
This is a no-op if there is no effective parent change.
The title object for the widget.
The title object is used by some container widgets when displaying the widget alongside some title, such as a tab panel or side bar.
Since not all widgets will use the title, it is created on demand.
The owner
property of the title is set to this widget.
The rendering context for painting the data grid.
Get the cell renderer map for the data grid.
Set the cell renderer map for the data grid.
The column header sections of the data grid.
The column sections of the data grid.
Get the copy configuration for the data grid.
Set the copy configuration for the data grid.
Get the default sizes for the various sections of the data grid.
Set the default sizes for the various sections of the data grid.
Whether the grid cells are editable.
editingEnabled
flag must be on and grid must have required
selection model, editor controller and data model properties.
Whether the cell editing is enabled for the data grid.
Whether the cell editing is enabled for the data grid.
The cell editor controller object for the data grid.
The cell editor controller object for the data grid.
The virtual height of the column headers.
Get the header visibility for the data grid.
Set the header visibility for the data grid.
The virtual width of the row headers.
Get the key handler for the data grid.
Set the key handler for the data grid.
The maximum scroll X position for the grid.
The maximum scroll Y position for the grid.
Get the minimum sizes for the various sections of the data grid.
Set the minimum sizes for the various sections of the data grid.
Get the mouse handler for the data grid.
Set the mouse handler for the data grid.
The height of the visible portion of the grid body.
The width of the visible portion of the grid body.
The row header sections of the data grid.
The row sections of the data grid.
The current scroll X position of the viewport.
The current scroll Y position of the viewport.
Get the selection model for the data grid.
Set the selection model for the data grid.
Get whether the last column is stretched.
Set whether the last column is stretched.
Get whether the last row is stretched.
Set whether the last row is stretched.
The viewport widget for the data grid.
The actual height of the viewport.
The actual width of the viewport.
Blit content into the on-screen grid canvas.
The rect should be expressed in viewport coordinates.
This automatically accounts for the dpi ratio.
Draw the background for the given paint region.
Draw the body region which intersects the dirty rect.
Draw the body selections for the data grid.
Draw the cells for the given paint region.
Draw the column background for the given paint region.
Draw the column header region which intersects the dirty rect.
Draw the column header selections for the data grid.
Draw the overlay cursor for the data grid.
Draw the horizontal grid lines for the given paint region.
Draw the row background for the given paint region.
Draw the row header region which intersects the dirty rect.
Draw the row header selections for the data grid.
Draw the overlay shadows for the data grid.
Draw the vertical grid lines for the given paint region.
Draw the void region for the dirty rect.
Handle the 'contextmenu'
event for the data grid.
Handle the 'keydown'
event for the data grid.
Handle the 'dblclick'
event for the data grid.
Handle the 'mousedown'
event for the data grid.
Handle the 'mouseleave'
event for the data grid.
Handle the 'mousemove'
event for the data grid.
Handle the 'mouseup'
event for the data grid.
Handle the 'wheel'
event for the data grid.
Resizes body column headers so their text fits without clipping or wrapping.
Resizes row header columns so their text fits without clipping or wrapping.
Returns column size
Returns row size
Handle cells changing in the data model.
Handle columns being inserted into the data model.
Handle columns moving in the data model.
Handle columns being removed from the data model.
A signal handler for the data model changed
signal.
Handle a full data model reset.
Handle the pageRequested
signal from a scroll bar.
A signal handler for the renderer map changed
signal.
Handle rows being inserted in the data model.
Handle rows moving in the data model.
Handle rows being removed from the data model.
A signal handler for the selection model changed
signal.
Handle the stepRequested
signal from a scroll bar.
Handle the thumbMoved
signal from a scroll bar.
A message hook invoked on a viewport 'column-resize-request'
message.
A message hook invoked on a viewport 'overlay-paint-request'
message.
A message hook invoked on a viewport 'paint-request'
message.
A message hook invoked on a viewport 'resize'
message.
A message hook invoked on a viewport 'row-resize-request'
message.
A message hook invoked on a viewport 'scroll-request'
message.
Paint the overlay content for the entire grid.
This is the primary overlay paint entry point. The individual
_draw*
methods should not be invoked directly. This method
dispatches to the drawing methods in the correct order.
Process a message sent to the viewport
Refresh the dpi ratio.
Release the mouse grab.
Ensure the canvas is at least the specified size.
This method will retain the valid canvas content.
Resize a column section immediately.
Resize a column header section immediately.
Resize a row section immediately.
Resize a row header section immediately.
Scroll immediately to the specified offset position.
Sync the scroll bars and scroll state with the viewport.
If the visibility of either scroll bar changes, a synchronous fit-request will be dispatched to the data grid to immediately resize the viewport.
Sync the viewport to the given scroll position.
This schedules a full repaint and syncs the scroll state.
Post an 'activate-request'
message to the widget.
This is a simple convenience method for posting the message.
Add a class name to the widget's DOM node.
The class name to add to the node.
If the class name is already added to the node, this is a no-op.
The class name must not contain whitespace.
Create an iterator over the widget's children.
A new iterator over the children of the widget.
The widget must have a populated layout in order to have children.
If a layout is not installed, the returned iterator will be empty.
Send a 'close-request'
message to the widget.
This is a simple convenience method for sending the message.
Get the column at a virtual offset in the data grid.
The region which holds the column of interest.
The virtual offset of the column of interest.
The index of the column, or -1
if the offset is out of range.
This method accounts for a stretched last column.
Get the column count for a particular region in the data grid.
The column region of interest.
The column count for the specified region.
Get the offset of a column in the data grid.
The region which holds the column of interest.
The index of the column of interest.
The offset of the column, or -1
if the index is out of range.
A stretched last column has no effect on the return value.
Get the size of a column in the data grid.
The region which holds the column of interest.
The index of the column of interest.
The size of the column, or -1
if the index is out of range.
This method accounts for a stretched last column.
Test whether a widget is a descendant of this widget.
The descendant widget of interest.
true
if the widget is a descendant, false
otherwise.
Copy the current selection to the system clipboard.
The grid must have a data model and a selection model.
The behavior can be configured via DataGrid.copyConfig
.
Dispose of the resources held by the widgets.
Draw the corner header region which intersects the dirty rect.
Post a 'fit-request'
message to the widget.
This is a simple convenience method for posting the message.
Auto sizes column widths based on their text content.
which area to resize: 'body', 'row-header' or 'all'.
padding added to resized columns (pixels).
specify cap on the number of column resizes (optional).
Handle the DOM events for the data grid.
The DOM event sent to the data grid.
This method implements the DOM EventListener
interface and is
called in response to events on the data grid's DOM node. It
should not be called directly by user code.
Test whether the widget's DOM node has the given class name.
The class name of interest.
true
if the node has the class, false
otherwise.
Hit test the viewport for the given client position.
The client X position of the mouse.
The client Y position of the mouse.
The hit test result, or null
if the client
position is out of bounds.
This method accounts for a stretched last row and/or column.
Map a client position to local viewport coordinates.
The client X position of the mouse.
The client Y position of the mouse.
The local viewport coordinates for the position.
Map a client position to virtual grid coordinates.
The client X position of the mouse.
The client Y position of the mouse.
The virtual grid coordinates for the position.
Intercept a message sent to a message handler.
The target handler of the message.
The message to be sent to the handler.
true
if the message should continue to be processed
as normal, or false
if processing should cease immediately.
Move cursor down/up/left/right while making sure it remains within the bounds of selected rectangles
The direction of the movement.
Invoke the message processing routine of the widget's layout.
The message to dispatch to the layout.
This is a no-op if the widget does not have a layout.
This will not typically be called directly by user code.
A message handler invoked on an 'activate-request'
message.
A message handler invoked on an 'after-attach'
message.
The default implementation of this handler is a no-op.
A message handler invoked on an 'after-detach'
message.
A message handler invoked on an 'after-hide'
message.
The default implementation of this handler is a no-op.
A message handler invoked on an 'after-show'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'before-attach'
message.
A message handler invoked on a 'before-detach'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'before-hide'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'before-show'
message.
A message handler invoked on a 'child-added'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'child-removed'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'close-request'
message.
The default implementation unparents or detaches the widget.
A message handler invoked on a 'fit-request'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'resize'
message.
A message handler invoked on an 'update-request'
message.
The default implementation of this handler is a no-op.
Paint the grid content for the given dirty rect.
The rect should be expressed in valid viewport coordinates.
This is the primary paint entry point. The individual _draw*
methods should not be invoked directly. This method dispatches
to the drawing methods in the correct order.
Process a message sent to the widget.
The message sent to the widget.
Remove a class name from the widget's DOM node.
The class name to remove from the node.
If the class name is not yet added to the node, this is a no-op.
The class name must not contain whitespace.
Schedule a repaint of all of the grid content.
Schedule a repaint of the overlay.
Schedule a repaint of specific grid content.
Reset modified columns to their default size.
The column region of interest.
Reset modified rows to their default size.
The row region of interest.
Resize a column in the data grid.
The region which holds the column of interest.
The index of the column of interest.
The desired size of the column.
Resize a row in the data grid.
The region which holds the row of interest.
The index of the row of interest.
The desired size of the row.
Get the row at a virtual offset in the data grid.
The region which holds the row of interest.
The virtual offset of the row of interest.
The index of the row, or -1
if the offset is out of range.
This method accounts for a stretched last row.
Get the row count for a particular region in the data grid.
The row region of interest.
The row count for the specified region.
Scroll the viewport by the specified amount.
The X scroll amount.
The Y scroll amount.
Scroll the viewport by one page.
The desired direction of the scroll.
Scroll the viewport by one cell-aligned step.
The desired direction of the scroll.
Scroll to the specified offset position.
The desired X position.
The desired Y position.
Scroll the grid to the specified cell.
The row index of the cell.
Scroll the grid to the specified column.
Scroll the grid to the current cursor position.
This is a no-op if the cursor is already visible or if there is no selection model installed on the grid.
Scroll the grid to the specified row.
Show or hide the widget according to a boolean value.
true
to hide the widget, or false
to show it.
This is a convenience method for hide()
and show()
.
Test whether the given widget flag is set.
This will not typically be called directly by user code.
Toggle a class name on the widget's DOM node.
The class name to toggle on the node.
Whether to force add the class (true
) or force
remove the class (false
). If not provided, the presence of
the class will be toggled from its current state.
true
if the class is now present, false
otherwise.
The class name must not contain whitespace.
Post an 'update-request'
message to the widget.
This is a simple convenience method for posting the message.
Attach a widget to a host DOM node.
The widget of interest.
The DOM node to use as the widget's host.
The child of host
to use as the reference element.
If this is provided, the widget will be inserted before this
node in the host. The default is null
, which will cause the
widget to be added as the last child of the host.
This will throw an error if the widget is not a root widget, if the widget is already attached, or if the host is not attached to the DOM.
A generic format function for the copy handler.
The format args for the function.
The string representation of the value.
This function uses String()
to coerce a value to a string.
Detach the widget from its host DOM node.
The widget of interest.
This will throw an error if the widget is not a root widget, or if the widget is not attached to the DOM.
The default copy config for a data grid.
The default sizes for a data grid.
The default theme for a data grid.
The default minimum sizes for a data grid.
Generated using TypeDoc
A widget which implements a high-performance tabular data grid. The namespace for the
DataGrid
class statics.Notes
A data grid is implemented as a composition of child widgets. These child widgets are considered an implementation detail. Manipulating the child widgets of a data grid directly is undefined behavior.
This class is not designed to be subclassed.