Skip to content

Commit 4b976fc

Browse files
authored
Refactor checkbox input in Grid helper - remove onclick and add class for js (#45910)
1 parent 3369297 commit 4b976fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/src/HTML/Helpers/Grid.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ public static function id($rowNum, $recId, $checkedOut = false, $name = 'cid', $
114114
if ($formId !== null) {
115115
return $checkedOut ? '' : '<label for="' . $stub . $rowNum . '"><span class="visually-hidden">' . Text::_('JSELECT')
116116
. ' ' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '</span></label>'
117-
. '<input class="form-check-input" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
118-
. '" onclick="Joomla.isChecked(this.checked, \'' . $formId . '\');">';
117+
. '<input class="form-check-input js-grid-item-is-checked" type="checkbox" id="' . $stub . $rowNum
118+
. '" name="' . $name . '[]" value="' . $recId . '" >';
119119
}
120120

121121
return $checkedOut ? '' : '<label for="' . $stub . $rowNum . '"><span class="visually-hidden">' . Text::_('JSELECT')
122122
. ' ' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '</span></label>'
123-
. '<input class="form-check-input" autocomplete="off" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
124-
. '" onclick="Joomla.isChecked(this.checked);">';
123+
. '<input class="form-check-input js-grid-item-is-checked" autocomplete="off" type="checkbox" id="' . $stub . $rowNum
124+
. '" name="' . $name . '[]" value="' . $recId . '" >';
125125
}
126126

127127
/**

0 commit comments

Comments
 (0)