1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace Atk4\Ui\Table\Column;
6:
7: use Atk4\Ui\Js\JsExpressionable;
8: use Atk4\Ui\JsCallback;
9: use Atk4\Ui\View;
10:
11: class JsHeaderDropdownCallback extends JsCallback
12: {
13: /**
14: * Function to call when header menu item is select.
15: *
16: * @param \Closure(string|null, string|null): (JsExpressionable|View|string|void) $fx
17: */
18: public function onSelectItem(\Closure $fx): void
19: {
20: $this->set(function () use ($fx) {
21: return $fx(
22: $this->getApp()->getRequestQueryParam('id'),
23: $this->getApp()->getRequestQueryParam('item')
24: );
25: });
26: }
27: }
28: