I think it's possible. You need to catch the parent select's change and update the child select accordingly like this:
class MyBoard extends \koolreport\dashboard\Dashboard
{
protected function widgets()
{
return [
...
Row::create([
[
Html::label("Parent")->style("font-weight:bold"),
BSelectParent::create(),
],
[
Html::label("Child")->style("font-weight:bold"),
BSelectChild::create(),
],
}
}
class BSelectParent extends \koolreport\dashboard\inputs\BSelect
{
...
protected function actionChange($request, $response)
{
$this->sibling("BSelectChild")->update(); // update the child select
}
}
class BSelectChild extends \koolreport\dashboard\inputs\BSelect
{
protected function onInit()
{
$parent = $this->sibling('BSelectParent')->value() ?? null; // scalar or array value depending on whether BSelectParent is single or multipel select
$selectData = ...;
$this
->props([
"dataSource" => $selectData,
"dataBind"=>[
"value" => ...,
"text" => ...,
],
]);
}
}