- @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]",data_fancycheckboxes_target= "checkbox" })
+ @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\", \"D1.MCIAPATT\",\"D1.MCIAPEX\",\"D1.MCIAPVIS\"]", data_fancycheckboxes_target= "checkbox" })
1
@@ -413,7 +413,7 @@
- @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]",data_fancycheckboxes_target= "checkbox" })
+ @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]", data_fancycheckboxes_target= "checkbox" })
1
diff --git a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js
index 457a952f..d5d30b7e 100644
--- a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js
+++ b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js
@@ -1,24 +1,21 @@
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
- static targets = ['checkbox']
+ static targets = ['checkbox']
- connect() {
- this.checkboxTargets.forEach((checkbox) => {
- checkbox.addEventListener('change', () => this.checkboxChange(checkbox))
- })
- }
+ connect() {
+ this.checkboxTargets.forEach((checkbox) => {
+ checkbox.addEventListener('click', () => this.checkboxChange(checkbox))
+ })
+ }
- checkboxChange(selectedCheckbox) {
- this.checkboxTargets.forEach((checkbox) => {
- if (checkbox !== selectedCheckbox) {
- checkbox.checked = false;
- checkbox.disabled = false;
- }
- })
+ checkboxChange(selectedCheckbox) {
+ this.checkboxTargets.forEach((checkbox) => {
+ if (checkbox !== selectedCheckbox) {
+ checkbox.checked = false;
+ checkbox.dispatchEvent(new Event('change'))
+ }
+ })
- if (selectedCheckbox.checked) {
- selectedCheckbox.disabled = false;
- }
- }
+ }
}
\ No newline at end of file