Skip to content

Commit 6de0b0e

Browse files
francoisfrancois
authored andcommitted
rn
1 parent 42bf66d commit 6de0b0e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/versions/release-notes/v6-3.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,37 @@ will now be refused for import as it may cause unexpected results.
205205

206206
Importing modules exported from lower major version is still supported.
207207

208+
### New front hooks beforeSave and afterSave
209+
210+
`Simplicite.UI.BusinessObject` contains 2 new hooks:
211+
212+
```javascript
213+
/**
214+
* Front hook before calling Ajax object.save()
215+
* @param ctn Form container
216+
* @param obj Object (same as this)
217+
* @param index record index (edit list)
218+
* @param cbk callback(true|false) (must return 'true' to continue or 'false' to stop/reject promise)
219+
*/
220+
beforeSave(ctn, obj, index, cbk) {
221+
cbk && cbk(true);
222+
}
223+
224+
/**
225+
* Front hook after calling Ajax object.save()
226+
* @param ctn Form container
227+
* @param obj Object (same as this)
228+
* @param index record index (edit list)
229+
* @param cbk callback(true|false) (must return 'true' to continue or 'false' to stop/reject promise)
230+
*/
231+
afterSave(ctn, obj, index, cbk) {
232+
cbk && cbk(true);
233+
}
234+
```
235+
236+
NB: previous hooks `form.beforesave` and `form.beforesave` are still available but it is recomanded to use the class BusinessObject.
237+
238+
208239
Fixes
209240
-----
210241

0 commit comments

Comments
 (0)