Skip to content

Commit e865805

Browse files
authored
Merge pull request #4432 from Laravel-Backpack/checklist-fixes
add support for js api in checklist field
2 parents 8e28d9b + 58ec5e9 commit e865805

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/resources/views/crud/fields/checklist.blade.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,18 @@ function bpFieldInitChecklist(element) {
8686
}
8787
});
8888
89-
hidden_input.val(JSON.stringify(newValue));
89+
hidden_input.val(JSON.stringify(newValue)).trigger('change');
9090
9191
});
92+
93+
hidden_input.on('backpack:field.disable', function(e) {
94+
checkboxes.attr('disabled', 'disabled');
95+
});
96+
97+
hidden_input.on('backpack:field.enable', function(e) {
98+
checkboxes.removeAttr('disabled');
99+
});
100+
92101
}
93102
</script>
94103
@endLoadOnce

0 commit comments

Comments
 (0)