Hi,
Please advise on how to bind first item from AutoMaker::rawSQL into Select2? As an example, I want to get the first team as default parameter, then using actionChange(), relevant table will be updated accordingly by default.
class TeamFilter extends Select2
{
protected function dataSource()
{
return AutoMaker::rawSQL
("
SELECT teams.id,
teams.description
FROM teams
");
}
protected function actionChange($request, $response)
{
$this->sibling("myReportTable")->update();
}
protected function fields()
{
return [
Number::create("id"),
Text::create("description"),
];
}
}
Thank you,