Reset pagination on filter scope change (#3632)

Fixes #3610. Credit to @stevemortimer
This commit is contained in:
Steve Mortimer 2018-07-16 08:43:47 -05:00 committed by Luke Towers
parent 157b08202b
commit 5936107c07
2 changed files with 10 additions and 1 deletions

View File

@ -239,7 +239,7 @@ class ListController extends ControllerBehavior
* Filter the list when the scopes are changed * Filter the list when the scopes are changed
*/ */
$filterWidget->bindEvent('filter.update', function () use ($widget, $filterWidget) { $filterWidget->bindEvent('filter.update', function () use ($widget, $filterWidget) {
return $widget->onRefresh(); return $widget->onFilter();
}); });
/* /*

View File

@ -300,6 +300,15 @@ class Lists extends WidgetBase
return $this->onRefresh(); return $this->onRefresh();
} }
/**
* Event handler for changing the filter
*/
public function onFilter()
{
$this->currentPageNumber = 1;
return $this->onRefresh();
}
/** /**
* Validate the supplied form model. * Validate the supplied form model.
* @return void * @return void