This isn't imposible today, but it is really tricky.
The idea is to enable the possibility to extend a ListController view, displaying another components beyond the list.
To archive this top scoreboard and this top table I needed the records, its just some sums, avgs and business rules calculations.
The records are fetched when the Lists widget is rendered, so usually, the records are only available after the main table on the screen.
The trick was to render on the controller method and then pass to
$this->asExtension('ListController')->index(); $this->vars['renderedList'] = $this->listRender();
And then I could access records from the Lists widget
$vars and pass it to my custom widgets.
/** @var LengthAwarePaginator $records */ $records = $this->widget->list->vars['records'];
Should not be better to pass the records to Lists widgets instead on letting it fetch them? So
$records would be a Controller property that can pass it to whatever widgets is bind to it.
This is exactly what I'm trying to do. Trying to access the list variables in my scoreboard... Isn't there any better way to do this?
@leocavalcante you have a working example of this? Can't seem to get it to work ^o)
1-4 of 4