https://github.com/fliplet/fliplet-widget-record-container
Data Record container
https://github.com/fliplet/fliplet-widget-record-container
Last synced: 9 months ago
JSON representation
Data Record container
- Host: GitHub
- URL: https://github.com/fliplet/fliplet-widget-record-container
- Owner: Fliplet
- Created: 2023-04-28T17:15:01.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T15:06:29.000Z (about 2 years ago)
- Last Synced: 2024-05-22T16:29:58.527Z (about 2 years ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fliplet Data Single data record Widget
## Development
This widget is meant to be used with the Fliplet platform.
Run for local development with the [`fliplet-cli`](https://github.com/Fliplet/fliplet-cli):
```
$ npm install
$ npm run watch
```
Then, keep the watcher running and on a new tab run the following command:
```
$ fliplet run
```
---
---
## Hooks
### repeaterDataRetrieved
This hook is triggered when the data is retrieved from the data source.
Attributes returned in the `options` object:
- `container`: the container element
- `entry`: the data source entry
- `vm`: the Vue instance of the widget
```js
Fliplet.Hooks.on('repeaterDataRetrieved', function(options) {
// options contains "container", "entry" and "vm"
});
```
---
### `recordContainerBeforeRetrieveData`
This hook is triggered before the entry is retrieved from the data source. It can be used to modify the data source query.
Attributes returned in the `options` object:
- `container`: the container element
- `connection`: the data source connection
- `vm`: the Vue instance of the widget
- `dataSourceId`: the data source id used for the connection
- `dataSourceEntryId`: the data source entry id to be loaded
```js
Fliplet.Hooks.on('recordContainerBeforeRetrieveData', function () {
// Modify the data source query used by "findOne" to retrieve the data
return { where: { name: 'John' } };
});
```