diff --git a/docs/general-concepts/forms-fields/standard-fields/subform.md b/docs/general-concepts/forms-fields/standard-fields/subform.md index 48f81c26..43d2a341 100644 --- a/docs/general-concepts/forms-fields/standard-fields/subform.md +++ b/docs/general-concepts/forms-fields/standard-fields/subform.md @@ -148,6 +148,16 @@ If you have javascript validation set in fields of your subform (set by the clas This is also true for custom fields which extend SubformField. +### Events + +- `subform-row-add` Event dispatched after new row has been added. Target: subform element. CustomEvent detail property contain affected row: `detail.row`. +- `joomla:updated` Event dispatched after new row has been added. Target: affected row element. +- `subform-row-remove` Event dispatched before removing the row. Target: subform element. CustomEvent detail property contain affected row: `detail.row`. +- `joomla:removed` Event dispatched before removing the row. Target: affected row element. +- `subform-order-changed` Event dispatched after rows ordering has been changed. Target: subform element. CustomEvent detail property contain affected row: `detail.row`, index of original position: `detail.fromPosition`, index of final position: `detail.toPosition`. + +All events are bubbles up in DOM. + ## Server-side validation and filters Server-side validation and filters are applied to the fields of the subform as normal, in the same way as when those fields are not part of a subform. diff --git a/migrations/60-61/new-features.md b/migrations/60-61/new-features.md index b63a0581..75469f18 100644 --- a/migrations/60-61/new-features.md +++ b/migrations/60-61/new-features.md @@ -29,3 +29,8 @@ Any changes in best practice. A new layout `joomla.form.field.subform.repeatable-grid` that renders subform fields in a grid (partially mimicking the table look), making it more responsive compared to the table layout. - PR: https://github.com/joomla/joomla-cms/pull/42347 + +## New event for `subform` field +Added `subform-order-changed` event when order is changed in subform field. + +- PR: https://github.com/joomla/joomla-cms/pull/46093