No Code Attached Yet
avatar jlexart-joomla
jlexart-joomla
13 Sep 2025

When I select one or more rows, the toolbar containing commands like publish, delete... is not activated.

public static function id($rowNum, $recId, $checkedOut = false, $name = 'cid', $stub = 'cb', $title = '', $formId = null)

If you add the onclick attribute, it will work: onclick="Joomla.isChecked(this.checked);"

Same function, on Joomla 5:

public static function id($rowNum, $recId, $checkedOut = false, $name = 'cid', $stub = 'cb', $title = '', $formId = null)
    {
        if ($formId !== null) {
            return $checkedOut ? '' : '<label for="' . $stub . $rowNum . '"><span class="visually-hidden">' . Text::_('JSELECT')
            . ' ' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '</span></label>'
            . '<input class="form-check-input" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
                . '" onclick="Joomla.isChecked(this.checked, \'' . $formId . '\');">';
        }

        return $checkedOut ? '' : '<label for="' . $stub . $rowNum . '"><span class="visually-hidden">' . Text::_('JSELECT')
        . ' ' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '</span></label>'
        . '<input class="form-check-input" autocomplete="off" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
            . '" onclick="Joomla.isChecked(this.checked);">';
    }
avatar jlexart-joomla jlexart-joomla - open - 13 Sep 2025
avatar joomla-cms-bot joomla-cms-bot - change - 13 Sep 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Sep 2025
avatar joeforjoomla
joeforjoomla - comment - 13 Sep 2025

Confirmed.

Found out that /media/system/js/list-view.min.js is no longer included and requires to be added explicitely:
$document->getWebAssetManager()->useScript('list-view');

avatar LadySolveig
LadySolveig - comment - 13 Sep 2025

Where exactly do you think this is missing?

Checked some files and in 6.0 should be there.

Frontend or backend?
Could you give an example?

avatar joeforjoomla
joeforjoomla - comment - 14 Sep 2025

We are talking about backend.

avatar LadySolveig
LadySolveig - comment - 14 Sep 2025

Can you please give an example code how you create the toolbar for your backend views.

As mentioned, the asset should be included automatically.

Only trying to find out why this is missing for you both.

We are talking about which version - 5 or 6?

Appreciate your support to find the potential issue.

avatar jlexart-joomla
jlexart-joomla - comment - 15 Sep 2025

Hi,
Yes, on my extension, I use the code below to create a checkbox for each row:
HTMLHelper::_('grid.id', $i, $item->id, false);

With Joomla 5, when this checkbox is checked, the toolbars will be enabled and the user can delete, publish... However, on Joomla 6 beta, it does not work. But if I check the check all button (Joomla.checkAll), it still works fine.

Image
avatar Fedik
Fedik - comment - 15 Sep 2025

@LadySolveig I not tested, but from quick look it seems missing in Joomla\CMS\HTML\Helpers\Grid::id() and Joomla\CMS\HTML\Helpers\Grid::checkall(), but last one still use inline JS so can ignore for now.

public static function id($rowNum, $recId, $checkedOut = false, $name = 'cid', $stub = 'cb', $title = '', $formId = null)

avatar LadySolveig
LadySolveig - comment - 15 Sep 2025

Thank you @Fedik pointing in the right direction.
In the core itself, it is necessary to comment out at least two places to trigger the issue.
Would be helpful if you could test the fix with the affected components. @jlexart-joomla @joeforjoomla

avatar richard67 richard67 - close - 15 Sep 2025
avatar richard67 richard67 - change - 15 Sep 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-09-15 13:23:15
Closed_By richard67
avatar richard67
richard67 - comment - 15 Sep 2025

Closing as having a pull request. Please test #46104 . Thanks in advance.

Add a Comment

Login with GitHub to post a comment