-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update plugin API docs with new FetchSelectedOptions, plus minor fixes (
#297)
- Loading branch information
1 parent
e8823b5
commit 5a8e160
Showing
7 changed files
with
133 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Interface: CustomSectionAPI | ||
|
||
[grist-plugin-api](../modules/grist_plugin_api.md).CustomSectionAPI | ||
|
||
Interface for the mapping of a custom widget. | ||
|
||
## Table of contents | ||
|
||
### Methods | ||
|
||
- [configure](grist_plugin_api.CustomSectionAPI.md#configure) | ||
- [mappings](grist_plugin_api.CustomSectionAPI.md#mappings) | ||
|
||
## Methods | ||
|
||
### configure | ||
|
||
▸ **configure**(`customOptions`): `Promise`<`void`\> | ||
|
||
Initial request from a Custom Widget that wants to declare its requirements. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `customOptions` | [`InteractionOptionsRequest`](grist_plugin_api.InteractionOptionsRequest.md) | | ||
|
||
#### Returns | ||
|
||
`Promise`<`void`\> | ||
|
||
___ | ||
|
||
### mappings | ||
|
||
▸ **mappings**(): `Promise`<``null`` \| [`WidgetColumnMap`](grist_plugin_api.WidgetColumnMap.md)\> | ||
|
||
Returns current widget configuration (if requested through configuration method). | ||
|
||
#### Returns | ||
|
||
`Promise`<``null`` \| [`WidgetColumnMap`](grist_plugin_api.WidgetColumnMap.md)\> |
51 changes: 51 additions & 0 deletions
51
help/code/interfaces/grist_plugin_api.FetchSelectedOptions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Interface: FetchSelectedOptions | ||
|
||
[grist-plugin-api](../modules/grist_plugin_api.md).FetchSelectedOptions | ||
|
||
Options for functions which fetch data from the selected table or record: | ||
|
||
- [onRecords](../modules/grist_plugin_api.md#onrecords) | ||
- [onRecord](../modules/grist_plugin_api.md#onrecord) | ||
- [fetchSelectedRecord](../modules/grist_plugin_api.md#fetchselectedrecord) | ||
- [fetchSelectedTable](../modules/grist_plugin_api.md#fetchselectedtable) | ||
- [GristView.fetchSelectedRecord](grist_plugin_api.GristView.md#fetchselectedrecord) | ||
- [GristView.fetchSelectedTable](grist_plugin_api.GristView.md#fetchselectedtable) | ||
|
||
The different methods have different default values for `keepEncoded` and `format`. | ||
|
||
## Table of contents | ||
|
||
### Properties | ||
|
||
- [format](grist_plugin_api.FetchSelectedOptions.md#format) | ||
- [includeColumns](grist_plugin_api.FetchSelectedOptions.md#includecolumns) | ||
- [keepEncoded](grist_plugin_api.FetchSelectedOptions.md#keepencoded) | ||
|
||
## Properties | ||
|
||
### format | ||
|
||
• `Optional` **format**: ``"columns"`` \| ``"rows"`` | ||
|
||
- `rows`, the returned data will be an array of objects, one per row, with column names as keys. | ||
- `columns`, the returned data will be an object with column names as keys, and arrays of values. | ||
|
||
___ | ||
|
||
### includeColumns | ||
|
||
• `Optional` **includeColumns**: ``"shown"`` \| ``"normal"`` \| ``"all"`` | ||
|
||
- `shown` (default): return only columns that are explicitly shown | ||
in the right panel configuration of the widget. This is the only value that doesn't require full access. | ||
- `normal`: return all 'normal' columns, regardless of whether the user has shown them. | ||
- `all`: also return special invisible columns like `manualSort` and display helper columns. | ||
|
||
___ | ||
|
||
### keepEncoded | ||
|
||
• `Optional` **keepEncoded**: `boolean` | ||
|
||
- `true`: the returned data will contain raw `CellValue`s. | ||
- `false`: the values will be decoded, replacing e.g. `['D', timestamp]` with a moment date. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters