You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a project, i needed to display different columns depending of the user role on the family listing.
I created a EventDispatcher on the getDataGrid() method to do this.
public function getDataGrid(string $code): DataGrid
{
$dataGrid = null;
if (!array_key_exists($code, $this->dataGrids)) {
$dataGrid = $this->buildDataGrid($code);
} else {
$dataGrid = $this->dataGrids[$code];
}
$this->eventDispatcher->dispatch(DataGridEvent::DATA_GRID_INITIALIZED, new DataGridEvent($dataGrid));
return $dataGrid;
}
And in my listenner I could change the DataGrid (columns and sortables) before to use it and render the views. I think it would be useful to have the EventDispatcher natively in the DataGrid.
What do you think about this solution ?
Regardes ! thx
The text was updated successfully, but these errors were encountered:
Hello,
I don't want to implement any event for this specific need, this method is easily extendable in the final controller in the project.
Just declare a specific controller for your need.
Hello !
For a project, i needed to display different columns depending of the user role on the family listing.
I created a EventDispatcher on the getDataGrid() method to do this.
And in my listenner I could change the DataGrid (columns and sortables) before to use it and render the views. I think it would be useful to have the EventDispatcher natively in the DataGrid.
What do you think about this solution ?
Regardes ! thx
The text was updated successfully, but these errors were encountered: