Add public methods to access Lists widget's sort direction & column (#4746)
Credit to @empower-josh.
This commit is contained in:
parent
aa31667952
commit
4ab464cede
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue