[]
Sheets.DataRange.IDataProvider
• host: DataRange
The data provider host.
▸ Optional
fromJSON(options
): void
Implement this hook to handle the deserialization.
Name | Type |
---|---|
options |
Object |
options.typeName |
string |
void
▸ Optional
getSpans(row
, col
, rowCount
, colCount
): Range
[]
Implement this hook to provide spans to data range cells. The row
, col
, rowCount
and colCount
parameters are based on the data range axis.
Name | Type |
---|---|
row |
number |
col |
number |
rowCount |
number |
colCount |
number |
Range
[]
▸ Optional
getStyle(row
, col
): Style
Implement this hook to provide styles to data range cells. The row
and col
parameters are based on the data range axis. It should return the style as GC.Spread.Sheets.Style
, otherwise, means fail to get style from data provider, so it will continue to get the style from sheet model.
Name | Type |
---|---|
row |
number |
col |
number |
▸ Optional
getValue(row
, col
): unknown
Implement this hook to provide values to data range cells. The row
and col
parameters are based on the data range axis. If returns undefined
, it means fail to get value from data provider, so it will continue to get the value from sheet model.
Name | Type |
---|---|
row |
number |
col |
number |
unknown
▸ Optional
onClear(row
, col
, rowCount
, colCount
, changes
): boolean
Implement this hook to handle the clear contents action. Return false
means prevent to clear data range contents. Default is false
.
Name | Type |
---|---|
row |
number |
col |
number |
rowCount |
number |
colCount |
number |
changes |
any [] |
boolean
▸ Optional
onColumnChange(col
, colCount
, changeType
, changes
): void
Implement this hook to receive changed columns information. The col
and colCount
parameters are based on the data range axis. Post your change into changes
parameter if you want undo/redo.
Name | Type |
---|---|
col |
number |
colCount |
number |
changeType |
"delete" | "add" |
changes |
any [] |
void
▸ Optional
onContextMenu(row
, col
, e
): boolean
Implement this hook to handle the mouse context menu action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
MouseEvent |
boolean
▸ Optional
onCopy(name
): boolean
| { dataProvider
: IDataProvider
; name
: string
}
Implement this hook to handle the copy action. Input parameter name
is copied data range name, need to return a different new data range name
and a data provider instance. Return false
means prevent to copy data range. Default is false
.
Name | Type |
---|---|
name |
string |
boolean
| { dataProvider
: IDataProvider
; name
: string
}
▸ Optional
onDestroy(): void
Implement this hook to handle the destroy action.
void
▸ Optional
onDoubleClick(row
, col
, e
): boolean
Implement this hook to handle the mouse double click action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
MouseEvent |
boolean
▸ Optional
onKeyDown(row
, col
, e
): boolean
Implement this hook to handle the key down action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
KeyboardEvent |
boolean
▸ Optional
onKeyUp(row
, col
, e
): boolean
Implement this hook to handle the key down action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
KeyboardEvent |
boolean
▸ Optional
onMouseDown(row
, col
, e
): boolean
Implement this hook to handle the mouse down action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
MouseEvent |
boolean
▸ Optional
onMouseMove(row
, col
, e
): boolean
Implement this hook to handle the mouse move action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
MouseEvent |
boolean
▸ Optional
onMouseUp(row
, col
, e
): boolean
Implement this hook to handle the mouse up action. The row
and col
parameters are based on the data range axis. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
row |
number |
col |
number |
e |
MouseEvent |
boolean
▸ Optional
onMouseWheel(deltaX
, deltaY
, e
): boolean
Implement this hook to handle the mouse wheel action. Return true
means prevent the next sheet actions. Default is false.
Name | Type |
---|---|
deltaX |
number |
deltaY |
number |
e |
MouseEvent |
boolean
▸ Optional
onRowChange(row
, rowCount
, changeType
, changes
): void
Implement this hook to receive changed rows information. The row
and rowCount
parameters are based on the data range axis. Post your change into changes
parameter if you want undo/redo.
Name | Type |
---|---|
row |
number |
rowCount |
number |
changeType |
"delete" | "add" |
changes |
any [] |
void
▸ Optional
setValue(row
, col
, value
, changes
): boolean
Implement this hook to receive the changed values from data range. The row
and col
parameters are based on the data range axis. Post your change into changes
parameter if you want undo/redo. If returns true
, it means set value successfully to data provider, so it will prevent to set the value to sheet model.
Name | Type |
---|---|
row |
number |
col |
number |
value |
unknown |
changes |
any [] |
boolean
▸ Optional
toJSON(): Object
Implement this hook to handle the serialization.
Object
Name | Type |
---|---|
typeName |
string |
▸ Optional
undo(change
): void
Implement this hook to handle the undo action. Input parameter change
is the user created in the corresponding hooks.
Name | Type |
---|---|
change |
any |
void