... | ... | @@ -7,11 +7,12 @@ But for now, here are some events that will be useful to you. |
|
|
|
|
|
|
|
|
|
|
|
| Event name | Fired by | Fired when |
|
|
|
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
|
| `resourceSelect` | `sib-display`, `sib-calendar`, `sib-map` | The user clicks an child in the list, with the resource as a detail of the event. |
|
|
|
| `populate` | `sib-display`, `sib-form`, `sib-calendar`, `sib-map` | The component got and displayed all its datas. |
|
|
|
| `save` | `sib-form` | The user validates the form. |
|
|
|
| Event name | Parameters | Fired by | Fired when |
|
|
|
| ---------------- | --------------------- | ---------------------------------------------------- | ------------------------------------------------------------ |
|
|
|
| `resourceSelect` | `{detail:{resource}}` | `sib-display`, `sib-calendar`, `sib-map` | The user clicks an child in the list, with the resource as a detail of the event. |
|
|
|
| `populate` | `{detail:{resource}}` | `sib-display`, `sib-form`, `sib-calendar`, `sib-map` | The component got and displayed all its datas. |
|
|
|
| `save` | `{detail:{resource}}` | `sib-form` | The form has saved successfully. |
|
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
... | ... | @@ -20,15 +21,15 @@ Use to do something if and when the element is generated. |
|
|
```js
|
|
|
element.addEventListener("populate", event => {
|
|
|
// Do something when the element is generated.
|
|
|
})
|
|
|
})
|
|
|
```
|
|
|
|
|
|
#### Save
|
|
|
Use to do something when a form is submitted.
|
|
|
Use to do something when a form is successfully saved.
|
|
|
```js
|
|
|
form.addEventListener("save", () => {
|
|
|
// Do something when the user validates the form.
|
|
|
});
|
|
|
form.addEventListener("save", event => {
|
|
|
// Do something when the form has been successfully saved.
|
|
|
});
|
|
|
|
|
|
```
|
|
|
|