You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/action.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,22 @@ If no `text` is given, the default text "Are you sure?" will be used.
54
54
confirm:true
55
55
```
56
56
57
+
### Emit
58
+
59
+
This event gets emitted right after triggering the action. In contrast to the `sucsess` or `failure` events, it will be emitted regardless of the server response.
60
+
61
+
```ruby
62
+
emit:"action_submitted"
63
+
```
64
+
65
+
### Delay
66
+
67
+
You can use this attribute if you want to delay the actual action submit request. It will not delay the event specified with the `emit` attribute.
68
+
69
+
```ruby
70
+
delay:1000# means 1000 ms
71
+
```
72
+
57
73
### Success
58
74
59
75
The success part of the action component gets triggered once the action we wanted to perform returns a success code, usually the `200` HTTP status code.
Copy file name to clipboardExpand all lines: docs/components/async.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,12 @@ Lazy (or defered) loading can be configured like shown [here](#defer).
28
28
29
29
If you want to simply hide the async component on initial pageload and display it later on, read below how to use `show_on`, which can be combined with `rerender_on`.
30
30
31
+
You can pass in multiple, comma-separated events on which the component should rerender.
32
+
33
+
```ruby
34
+
async rerender_on:'my_event, some_other_event'
35
+
```
36
+
31
37
### Show_on
32
38
33
39
The `show_on` option lets us define an event on which the component gets shown. The content is still rendered on init pageload, but simply hidden in the browser until the event is emitted. If you want to have proper deferred loading, please refer to [defer](#defer)
@@ -40,6 +46,12 @@ async show_on: 'my_event' do
40
46
end
41
47
```
42
48
49
+
You can pass in multiple, comma-separated events on which the component should be shown.
50
+
51
+
```ruby
52
+
async show_on:'my_event, some_other_event'
53
+
```
54
+
43
55
### Hide_on
44
56
45
57
The `hide_on` option lets us define an event on which the component gets hidden.
@@ -52,6 +64,13 @@ async hide_on: 'my_event' do
52
64
end
53
65
```
54
66
67
+
You can pass in multiple, comma-separated events on which the component should be hidden.
68
+
69
+
```ruby
70
+
async hide_on:'my_event, some_other_event'
71
+
```
72
+
73
+
55
74
### Hide_after
56
75
57
76
The `hide_after` option lets us define a timespan in milliseconds after which the component gets hidden.
Copy file name to clipboardExpand all lines: docs/components/form.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,21 @@ Using the standard Rails params, we can pass information to our route!
106
106
params: { id:42 }
107
107
```
108
108
109
+
### Emit
110
+
111
+
This event gets emitted right after form submit. In contrast to the `sucsess` or `failure` events, it will be emitted regardless of the server response.
112
+
113
+
```ruby
114
+
emit:"form_submitted"
115
+
```
116
+
117
+
### Delay
118
+
119
+
You can use this attribute if you want to delay the actual form submit request. It will not delay the event specified with the `emit` attribute.
120
+
121
+
```ruby
122
+
delay:1000# means 1000 ms
123
+
```
109
124
110
125
### Success
111
126
@@ -1348,4 +1363,4 @@ datalist id: 'datalist-id' do
0 commit comments