Skip to content

Commit ca7f97e

Browse files
authored
Merge pull request #4598 from Laravel-Backpack/crudfields-callbacks-event
CrudFields - Subfields callbacks on the fly
2 parents ad6f2e3 + 4ad52e7 commit ca7f97e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/resources/views/crud/inc/form_fields_script.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class CrudField {
8080
if(this.isSubfield) {
8181
window.crud.subfieldsCallbacks[this.parent.name] ??= [];
8282
window.crud.subfieldsCallbacks[this.parent.name].push({ closure, field: this });
83+
this.wrapper.trigger('CrudField:subfieldCallbacksUpdated');
8384
return this;
8485
}
8586
@@ -95,7 +96,7 @@ class CrudField {
9596
if(this.isSubfield) {
9697
window.crud.subfieldsCallbacks[this.parent.name]?.forEach(callback => callback.triggerChange = true);
9798
} else {
98-
this.$input.trigger(`change`);
99+
this.$input.trigger('change');
99100
}
100101
101102
return this;

0 commit comments

Comments
 (0)