Skip to content

Conversation

@alexandre-castelain
Copy link
Contributor

Description

This Merge Request introduces documentation for handling the query option in DataTables. It explains how to define a default query within a DataTableType and how to override or extend it from a controller, providing flexibility similar to the Symfony Form component.

Default definition:

class ProductDataTableType extends AbstractDataTableType 
{
    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'query' => $this->productRepository->createQueryBuilder('p'),
        ]);
    }
}
$dataTable = $this->createDataTable(ProductDataTableType::class);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant