问题
I have followed through the tutorial, http://docs.joomla.org/Adding_sortable_columns_to_a_table_in_a_component
When I have followed all instructions there, I was able sort the columns, but with only ASC direction and there is no arrow indicator.
Does anyone happen to know how to enable both ASC and DESC as well as arrow graphic indicator?
Thanks a lot.
回答1:
In the documentation it says something like below: ASC is right there.
public function getListQuery() {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// ...
$query->order($db->escape($this->getState('list.ordering', 'default_sort_column')).' '.
$db->escape($this->getState('list.direction', 'ASC')));
return $query;
}
来源:https://stackoverflow.com/questions/19783791/how-to-add-sortable-columns-in-a-joomla-component-table-both-asc-and-desc-wit