parent
495b0f085a
commit
a68f3abf1c
|
|
@ -212,7 +212,7 @@ class ListController extends ControllerBehavior
|
|||
*/
|
||||
if ($searchWidget = $toolbarWidget->getSearchWidget()) {
|
||||
$searchWidget->bindEvent('search.submit', function () use ($widget, $searchWidget) {
|
||||
$widget->setSearchTerm($searchWidget->getActiveTerm());
|
||||
$widget->setSearchTerm($searchWidget->getActiveTerm(), true);
|
||||
return $widget->onRefresh();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -642,9 +642,7 @@ class Lists extends WidgetBase
|
|||
protected function getCurrentPageNumber($query)
|
||||
{
|
||||
$currentPageNumber = $this->currentPageNumber;
|
||||
|
||||
if (!$currentPageNumber && empty($this->searchTerm)) {
|
||||
// Restore the last visited page from the session if available.
|
||||
if (empty($currentPageNumber)) {
|
||||
$currentPageNumber = $this->getSession('lastVisitedPage');
|
||||
}
|
||||
|
||||
|
|
@ -1410,13 +1408,18 @@ class Lists extends WidgetBase
|
|||
* Applies a search term to the list results, searching will disable tree
|
||||
* view if a value is supplied.
|
||||
* @param string $term
|
||||
* @param boolean $resetPagination
|
||||
*/
|
||||
public function setSearchTerm($term)
|
||||
public function setSearchTerm($term, $resetPagination = false)
|
||||
{
|
||||
if (!empty($term)) {
|
||||
$this->showTree = false;
|
||||
}
|
||||
|
||||
if ($resetPagination) {
|
||||
$this->currentPageNumber = 1;
|
||||
}
|
||||
|
||||
$this->searchTerm = $term;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@
|
|||
name="page"
|
||||
class="form-control input-sm custom-select select-no-search"
|
||||
data-request="<?= $this->getEventHandler('onPaginate') ?>"
|
||||
data-load-indicator="<?= e(trans('backend::lang.list.loading')) ?>">
|
||||
data-load-indicator="<?= e(trans('backend::lang.list.loading')) ?>"
|
||||
autocomplete="off">
|
||||
<?php for($i = 1; $i <= $pageLast ; $i++): ?>
|
||||
<option value="<?= $i ?>" <?= $i === $pageCurrent ? 'selected' : '' ?>><?= $i ?></option>
|
||||
<?php endfor ?>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@
|
|||
<select
|
||||
disabled
|
||||
name="page"
|
||||
class="form-control input-sm custom-select select-no-search">
|
||||
class="form-control input-sm custom-select select-no-search"
|
||||
autocomplete="off">
|
||||
<option value="<?= $pageCurrent ?>" selected><?= $pageCurrent ?></option>
|
||||
</select>
|
||||
<?php if ($hasMorePages): ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue