No Code Attached Yet
avatar joeforjoomla
joeforjoomla
25 Mar 2023

Steps to reproduce the issue

Try to order table columns using:

HTMLHelper::_('grid.sort', 'Text', 's.title', $this->orders['order_Dir'], $this->orders['order'], 'contents.display');

Expected result

Ordering still works

Actual result

Ordering does not work

System information (as much as possible)

Caused by removing the onclick handler in the sort function:

$html = '<a href="#" onclick="Joomla.tableOrdering('' . $order . '','' . $direction . '','' . $task . ''' . $form . ');return false;"'
. ' class="hasTooltip" title="' . htmlspecialchars(Text::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) . '" data-bs-placement="top">';

and replaced with:

$html = '<a href="#" class="hasTooltip" title="' . htmlspecialchars(Text::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) . '"'
. ' data-ordering-order="' . $order . '"'
. ' data-ordering-direction="' . $direction . '"'
. ' data-ordering-task="' . $task . '"'
. ' data-ordering-form="' . (isset($form) ? $form : '') . '"'
. ' data-bs-placement="top">';

avatar joeforjoomla joeforjoomla - open - 25 Mar 2023
avatar joomla-cms-bot joomla-cms-bot - change - 25 Mar 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Mar 2023
avatar dgrammatiko
dgrammatiko - comment - 25 Mar 2023

Is the table on the front end or the backend?

avatar joeforjoomla
joeforjoomla - comment - 25 Mar 2023

I mean in the backend... looks like there is no longer a JS handler to call the Joomla.tableOrdering function

avatar dgrammatiko
dgrammatiko - comment - 25 Mar 2023

looks like there is no longer a JS handler to call the Joomla.tableOrdering function

That shouldn't be a problem for the backend as there is already JS code to handle that. Does your page uses searchtools?

avatar obuisard
obuisard - comment - 25 Mar 2023

@joeforjoomla can you check if PR#40192 fixes the issue?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40191.

avatar joeforjoomla
joeforjoomla - comment - 26 Mar 2023

@joeforjoomla can you check if PR#40192 fixes the issue?

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40191.

@obuisard yes #40192 fixes the issue. Indeed the problem was the inline handler that was removed.
@dgrammatiko also in the backend there was no JS code to handle that, once removed the inline handler.

avatar alikon
alikon - comment - 26 Mar 2023

closing as we have a pr #40192

avatar alikon alikon - change - 26 Mar 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-03-26 07:08:21
Closed_By alikon
avatar alikon alikon - close - 26 Mar 2023

Add a Comment

Login with GitHub to post a comment