diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index 1026596ca..7896fb8ef 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -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 *