Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
I'm trying this one
Row::create([
[
Html::label("Choix du signataire")->style("font-weight:bold"),
Select2::create('selectSignataire')
->placeHolder("Choisir un signataire")
->dataSource(function ($params = null) {
if (isset($params['search']) && !empty($params['search'])) {
$keyword = $params['search'];
return AdminAutoMaker::table('clients')
->select('id', 'CONCAT(prenom, " ", nom, " ", societe) as name')
->whereRaw('CONCAT(prenom, " ", nom, " ", societe) LIKE ?', ["%$keyword%"])
->limit(10)
->run();
}
return [];
})
->multiple(false)
->fields([
Number::create('id'),
Text::create('name'),
])->options([
'minimumInputLength' => 1,
])->cssStyle("width:100%;"),
],
]),
But no result, i'm trying to call the data but not all table, but not work
Maybe the options property is overwritten by a default empty array value after it is created. I would suggest you create class called MySelect2 like this:
class MySelect2 extends \koolreport\dashboard\inputs\Select2
{
protected function onInit()
{
$this
...
->options([
...
'minimumInputLength' => 2,
])
;
}
protected function dataSource()
{
return ...;
}
Then use this MySelect2 class in your dashboard intead of a direct Select2 create.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo