How to add sortable columns in a Joomla component (table), both ASC and DESC with an arrow

倾然丶 夕夏残阳落幕 提交于 2019-12-11 19:28:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!