Grid
High-performance, flexible spreadsheet control
Extends
Constructors
new Grid()
new Grid(
dart):Grid
Parameters
| Parameter | Type |
|---|---|
dart | any |
Returns
Overrides
Source
Properties
| Property | Modifier | Type | Default value | Description | Inherited from |
|---|---|---|---|---|---|
_functions | protected | Func[] | [] | - | Viewer._functions |
_properties | protected | Property[] | [] | - | Viewer._properties |
_root | protected | HTMLElement | undefined | - | Viewer._root |
dart | public | any | undefined | - | Viewer.dart |
factory | public | null | Func | null | Constructor function. No parameters, returns [Widget]. | Viewer.factory |
isDetached | public | boolean | false | - | Viewer.isDetached |
props | public | IGridSettings & ObjectPropertyBag | undefined | - | Viewer.props |
subs | public | Subscription[] | undefined | - | Viewer.subs |
tags | public | any | undefined | - | Viewer.tags |
temp | public | any | undefined | Contains auxiliary information | Viewer.temp |
CORE_VIEWER_TYPES | static | string[] | ... | - | Viewer.CORE_VIEWER_TYPES |
Accessors
canvas
getcanvas():HTMLCanvasElement
Returns
HTMLCanvasElement
Source
children
getchildren():Widget<any>[]
Parent widget up the DOM tree, or null.
Returns
Widget<any>[]
Source
colHeaderBox
getcolHeaderBox():Rect
Column labels box
Returns
Source
colHeaderHeight
getcolHeaderHeight():number
Column labels height
Returns
number
Source
columns
getcolumns():GridColumnList
Grid columns.
Returns
Source
dataFrame
getdataFrame():DataFrame
setdataFrame(t):void
Parameters
| Parameter | Type |
|---|---|
t | DataFrame |
Returns
Source
descriptor
getdescriptor():WidgetDescriptor
Descriptor of this widget.
Returns
Source
filter
getfilter():BitSet
combined filter of the viewer
setfilter(f):void
Parameters
| Parameter | Type |
|---|---|
f | BitSet |
Returns
Source
helpUrl
gethelpUrl():string
Help URL
sethelpUrl(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
horzScroll
gethorzScroll():RangeSlider
Horizontal scroll bar
Returns
Source
meta
getmeta():ViewerMetaHelper
Returns
Source
onAfterDrawContent
getonAfterDrawContent():Observable<EventData<any>>
Returns
Observable <EventData<any>>
Source
onAfterDrawOverlay
getonAfterDrawOverlay():Observable<EventData<any>>
Returns
Observable <EventData<any>>
Source
onBeforeDrawContent
getonBeforeDrawContent():Observable<EventData<any>>
Returns
Observable <EventData<any>>
Source
onBeforeDrawOverlay
getonBeforeDrawOverlay():Observable<EventData<any>>
Returns
Observable <EventData<any>>
Source
onCellClick
getonCellClick():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onCellDoubleClick
getonCellDoubleClick():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onCellKeyDown
getonCellKeyDown():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onCellMouseDown
getonCellMouseDown():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onCellMouseEnter
getonCellMouseEnter():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onCellMouseLeave
getonCellMouseLeave():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onCellRender
getonCellRender():Observable<GridCellRenderArgs>
Occurs after the grid cell has been rendered. Do args.preventDefault() to prevent standard rendering.
Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-rendering-indexes
See also onCellRendered.
Returns
Observable <GridCellRenderArgs>
Source
onCellRendered
getonCellRendered():Observable<GridCellRenderArgs>
Occurs after the grid cell has been rendered. See also onCellRender.
Returns
Observable <GridCellRenderArgs>
Source
onCellValueEdited
getonCellValueEdited():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onColumnResized
getonColumnResized():Observable<any>
Sample: https://public.datagrok.ai/js/samples/grid/resize-events
Returns
Observable<any>
Source
onContextMenu
getonContextMenu():Observable<Menu>
Returns
Observable <Menu>
Source
onCurrentCellChanged
getonCurrentCellChanged():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onDartPropertyChanged
getonDartPropertyChanged():Observable<null>
Returns
Observable<null>
Source
onDataEvent
getonDataEvent():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onDataRowClicked
getonDataRowClicked():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onDataSelected
getonDataSelected():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onDetached
getonDetached():Observable<any>
Occurs when viewer is detached.
Returns
Observable<any>
Source
onGridCellLinkClicked
getonGridCellLinkClicked():Observable<EventData<GridCellArgs>>
Returns
Observable <EventData <GridCellArgs>>
Source
onPinnedRowsChanged
getonPinnedRowsChanged():Observable<any>
Returns
Observable<any>
Source
onPropertyValueChanged
getonPropertyValueChanged():Observable<EventData<Property>>
Returns
Observable <EventData <Property>>
Source
onRowEnter
getonRowEnter():Observable<GridCell<any>>
Returns
Observable <GridCell<any>>
Source
onRowsResized
getonRowsResized():Observable<any>
Sample: https://public.datagrok.ai/js/samples/grid/resize-events
Returns
Observable<any>
Source
onRowsSorted
getonRowsSorted():Observable<any>
Sample: https://public.datagrok.ai/js/samples/grid/order-rows
Returns
Observable<any>
Source
onTooltipCreated
getonTooltipCreated():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onTooltipCreating
getonTooltipCreating():Observable<GridTooltipArgs>
Returns
Observable <GridTooltipArgs>
Source
overlay
getoverlay():HTMLCanvasElement
Returns
HTMLCanvasElement
Source
parent
getparent():null|Widget<any>
Parent widget up the DOM tree, or null.
Returns
null | Widget<any>
Source
pinnedRows
getpinnedRows():Iterable<number>
Pinned rows.
Returns
Iterable<number>
Source
root
getroot():HTMLElement
Visual root.
Returns
HTMLElement
Source
sortByColumns
getsortByColumns():Column<any,any>[]
List of columns the grid is sorted by.
Returns
Column<any, any>[]
Source
sortTypes
getsortTypes():boolean[]
Sort directions for [sortByColumns]: true = ascending order, false = descending order.
Returns
boolean[]
Source
table
gettable():DataFrame
Returns
Source
tableView
gettableView():null|TableView
Returns a view this viewer is associated with, or null
Returns
null | TableView
Source
type
gettype():string
Returns viewer type (see VIEWER constants)
Returns
string
Source
vertScroll
getvertScroll():RangeSlider
Vertical scroll bar. Sample: https://public.datagrok.ai/js/samples/grid/scroll-bars
Returns
Source
view
getview():null|View
Returns a view this viewer is associated with, or null
Returns
null | View
Source
Methods
addProperty()
privateaddProperty(propertyName,propertyType,defaultValue,options):any
Registers an property with the specified type, name, and defaultValue.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
propertyName | string | undefined | |
propertyType | "string" | "bigint" | "object" | "map" | "file" | "view" | "blob" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | "num" | "string_list" | "dataframe_list" | "cell" | "column" | "column_list" | "graphics" | "tablerowfiltercall" | "colfiltercall" | "bitset" | "dynamic" | "viewer" | "list" | "semantic_value" | "func" | "funccall" | "property" | "categorical" | "numerical" | "GridCellRenderArgs" | "element" | "TableView" | "User" | "Menu" | "Project" | "event_data" | "progressindicator" | "Credentials" | "ScriptEnvironment" | "Notebook" | undefined | |
defaultValue | any | null | |
options | null | object & IProperty | null |
Returns
any
Inherited from
See
Registered property gets added to properties. Returns default value, thus allowing to combine registering a property with the initialization
Source
apply()
apply(
properties):Widget<any>
Parameters
| Parameter | Type | Description |
|---|---|---|
properties | object |
Returns
Widget<any>
Inherited from
Source
autoSize()
autoSize(
maxWidth,maxHeight,minWidth?,minHeight?,autoSizeOnDataChange?):void
Resizes the grid to fit the content
Parameters
| Parameter | Type |
|---|---|
maxWidth | number |
maxHeight | number |
minWidth? | number |
minHeight? | number |
autoSizeOnDataChange? | boolean |
Returns
void
Source
cell()
cell(
columnName,gridRow):GridCell<any>
Returns a grid cell at the specified position.
Parameters
| Parameter | Type |
|---|---|
columnName | string |
gridRow | number |
Returns
GridCell<any>
Source
close()
close():
void
Closes and detaches the viewer.
Returns
void
Inherited from
Source
col()
col(
name):null|GridColumn<any>
Returns a column with the specified name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string |
Returns
null | GridColumn<any>
Source
copyViewersLook()
copyViewersLook(
other):void
Parameters
| Parameter | Type |
|---|---|
other | Viewer<any> |
Returns
void
Inherited from
Source
detach()
detach():
void
Gets called when a widget is detached and will no longer be used. Typically used for unsubscribing from events. Be sure to call super.detach() if this method is overridden.
Returns
void