I've added a SelectBox to a Dashboard Board. However, it can't find the data source, despite the php file being present.
The error is stating that it can't find the Datasource, despite my stating it in the 'use' list. It also couldn't find the Automaker.php datasource.
//SelectDemo.php
<?php
//namespace demo\inputs;
use \koolreport\dashboard\inputs\Select;
use \koolreport\dashboard\fields\Text;
use \koolreport\dashboard\fields\Number;
use \demo\DealHack; //EXPLCITLY LOCATING Dealhack DataSource
use \demo\AutoMaker;
class SelectDemo extends Select
{
// protected function onCreated()
// {
// $this->defaultOption(["--"=>null]);
// }
protected function dataSource()
{
return DealHack::table("tbl_company") //LINE 20 CAUSING ERROR
->select("CompanyName")
->limit(5);
}
// protected function actionChange($request, $response)
// {
// $this->sibling("Result")->update();
// }
protected function fields()
{
return [
Text::create("CompanyName"),
];
}
}
DealhackBoard.php
<?php
use \koolreport\dashboard\Dashboard;
use \koolreport\dashboard\containers\Row;
use \koolreport\dashboard\containers\Panel;
use \koolreport\dashboard\widgets\Text;
use \koolreport\dashboard\widgets\StateHolder;
use \koolreport\dashboard\menu\MenuItem;
use \koolreport\dashboard\Client;
use \koolreport\dashboard\containers\Html;
use \koolreport\dashboard\Container;
use \koolreport\dashboard\inputs\Button;
class DealhackBoard extends Dashboard
{
protected function widgets()
{
return [
SelectDemo::create(),
Html::label("TextBox")->style("font-weight:bold"),
TextBoxDemo::create(),
DealhackTable::create(),
ProductByLine::create(),
];
}
}
?>