For those using the (in my opinion excellent) JDeveloper component on Joomla 3.6 to create custom components, I've noticed that there is an issue on the admin table layout whereby you can not sort the columns or use the ordering feature.

  • Could you please post the solution as a proper answer below
    – Lodder
    Commented Sep 20, 2016 at 13:00
  • Thanks for the tip @Lodder, answer moved from question an put where it belongs in the answer section
    – philip
    Commented Sep 21, 2016 at 7:52

1 Answer 1


Here are the fixes that you need to do to get them to work



You'll see a line

$saveOrder = ($listOrder == 'ordering' && isset($this->items[0]->ordering));

Notice it checks the listOrder to be equal to 'ordering' (we'll get back to this)

Just below, change

$saveOrderingUrl = 'index.php?option=com_yourcomponent&task=yourviewplural.ordering&tmpl=component';


$saveOrderingUrl = 'index.php?option=com_yourcomponent&task=yourviewplural.saveOrderAjax&tmpl=component';

Scroll down utill you get to the table headings.

The first column is the ordering column, here is where the next bug sits. Notice that is has the ordering target set to 'a.ordering' but our variable $saveOrder checks for 'ordering'


<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>


<?php echo JHtml::_('searchtools.sort', '', 'ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>

I've found that searchtools.sort and grid.sort do not seem to work together so replace all occurances of grid.sort with searchtools.sort

If you have a 'featured' column you will need to make another modification as you can't use the title to display the featured icon. searchtools does however have a parameter for icon.


<?php echo JHtml::_('grid.sort', JText::_('<span class="icon-featured"></span>'), 'a.featured', $listDirn, $listOrder) ?>


<?php echo JHtml::_('searchtools.sort', null, 'a.featured', $listDirn, $listOrder, null, null, 'Featured', 'icon-featured') ?>

Save the file, we're done with this one.

Open /administrator/com_yourcomponent/models/forms/filter_yourviewplural.xml

Scroll to the bottom where you will see the list field with the name="fullordering" In the option list find a.ordering ASC and a.ordering DESC and remove the a.

i.e from

<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>


<option value="ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="ordering DESC">JGRID_HEADING_ORDERING_DESC</option>

Save the file. We are done, sort and ordering now work as they should. Hope this helps someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.