mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Reset column order for lists when using "Reset to Default" action (#217)
This commit is contained in:
parent
087bd2b6ff
commit
dc0d6aa0e2
@ -841,7 +841,7 @@ class Lists extends WidgetBase
|
||||
/*
|
||||
* Use a supplied column order
|
||||
*/
|
||||
if ($columnOrder = $this->getSession('order', null)) {
|
||||
if ($columnOrder = $this->getUserPreference('order', null)) {
|
||||
$orderedDefinitions = [];
|
||||
foreach ($columnOrder as $column) {
|
||||
if (isset($this->allColumns[$column])) {
|
||||
@ -1675,7 +1675,7 @@ class Lists extends WidgetBase
|
||||
}
|
||||
|
||||
$this->recordsPerPage = post('records_per_page', $this->recordsPerPage);
|
||||
$this->putSession('order', post('column_order'));
|
||||
$this->putUserPreference('order', post('column_order'));
|
||||
$this->putUserPreference('per_page', $this->recordsPerPage);
|
||||
return $this->onRefresh();
|
||||
}
|
||||
@ -1685,6 +1685,7 @@ class Lists extends WidgetBase
|
||||
*/
|
||||
public function onResetSetup()
|
||||
{
|
||||
$this->clearUserPreference('order');
|
||||
$this->clearUserPreference('visible');
|
||||
$this->clearUserPreference('per_page');
|
||||
return $this->onRefresh();
|
||||
|
Loading…
x
Reference in New Issue
Block a user