Implement Icinga\Web\Widget\SortBox::handleRequest()

refs #9220
This commit is contained in:
Alexander A. Klimov 2015-05-11 16:09:20 +02:00
parent 17ebe07e57
commit 32659647b9
1 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,7 @@ namespace Icinga\Web\Widget;
use Icinga\Web\Form;
use Icinga\Web\Request;
use Icinga\Data\Sortable;
use Icinga\Application\Icinga;
/**
* SortBox widget
@ -106,6 +107,17 @@ class SortBox extends AbstractWidget
return $this;
}
public function handleRequest(Request $request = null)
{
if ($request === null) {
$request = Icinga::app()->getFrontController()->getRequest();
}
if ($sort = $request->getParam('sort')) {
$this->query->order($sort, $request->getParam('dir'));
}
return $this;
}
/**
* Render this SortBox as HTML
*