mirror of https://github.com/artf/grapesjs.git
4 changed files with 78 additions and 0 deletions
@ -0,0 +1,61 @@ |
|||||
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> |
||||
|
|
||||
|
## add |
||||
|
|
||||
|
Add new data source. |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
* `props` **[Object][1]** Data source properties. |
||||
|
* `opts` **AddOptions** (optional, default `{}`) |
||||
|
|
||||
|
### Examples |
||||
|
|
||||
|
```javascript |
||||
|
const ds = dsm.add({ |
||||
|
id: 'my_data_source_id', |
||||
|
records: [ |
||||
|
{ id: 'id1', name: 'value1' }, |
||||
|
{ id: 'id2', name: 'value2' } |
||||
|
] |
||||
|
}); |
||||
|
``` |
||||
|
|
||||
|
Returns **[DataSource]** Added data source. |
||||
|
|
||||
|
## get |
||||
|
|
||||
|
Get data source. |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
* `id` **[String][2]** Data source id. |
||||
|
|
||||
|
### Examples |
||||
|
|
||||
|
```javascript |
||||
|
const ds = dsm.get('my_data_source_id'); |
||||
|
``` |
||||
|
|
||||
|
Returns **[DataSource]** Data source. |
||||
|
|
||||
|
## remove |
||||
|
|
||||
|
Remove data source. |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
* `id` **([String][2] | [DataSource])** Id of the data source. |
||||
|
* `opts` **RemoveOptions?** |
||||
|
|
||||
|
### Examples |
||||
|
|
||||
|
```javascript |
||||
|
const removed = dsm.remove('DS_ID'); |
||||
|
``` |
||||
|
|
||||
|
Returns **[DataSource]** Removed data source. |
||||
|
|
||||
|
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object |
||||
|
|
||||
|
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String |
||||
@ -0,0 +1,7 @@ |
|||||
|
--- |
||||
|
title: Data Sources |
||||
|
--- |
||||
|
|
||||
|
# Data Sources |
||||
|
|
||||
|
Hey World |
||||
Loading…
Reference in new issue