omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
252 stars 113 forks source link

Multiple DataTables on one template #186

Closed bmeloski closed 3 years ago

bmeloski commented 3 years ago

It is either not implemented or I don't understand how to do it. Multiple DataTables return values of only one table (if you have 2 entities mapped, request responds with only one dataset).

MaximePinot commented 3 years ago

If you want to display more than one DataTable on the same page, make sure to give each DataTable a unique name (default name is dt).

$datatableOne = $dataTableFactory->createFromType(FirstTableType::class)
    ->setName('datatable_one');

$datatableTwo = $dataTableFactory->createFromType(SecondTableType::class)
    ->setName('datatable_two');
bmeloski commented 3 years ago

Thank you! it's working