Add public methods to access Lists widget's sort direction & column (#4746)

Credit to @empower-josh.
This commit is contained in:
empower-josh 2019-12-04 01:29:24 -07:00 committed by Luke Towers
parent aa31667952
commit 4ab464cede
1 changed files with 9 additions and 1 deletions

View File

@ -1517,7 +1517,7 @@ class Lists extends WidgetBase
/**
* Returns the current sorting column, saved in a session or cached.
*/
protected function getSortColumn()
public function getSortColumn()
{
if (!$this->isSortable()) {
return false;
@ -1564,6 +1564,14 @@ class Lists extends WidgetBase
return $this->sortColumn;
}
/*
* Returns the current sort direction or default of 'asc'
*/
public function getSortDirection()
{
return $this->sortDirection ?? 'asc';
}
/**
* Returns true if the column can be sorted.
*/