Kreyu / data-table-bundle

Streamlines creation process of the data tables in Symfony applications. NOT PRODUCTION READY.
https://data-table-bundle.swroblewski.pl
MIT License
75 stars 14 forks source link

Missing query declaration in documentation #82

Closed Kazadri closed 6 months ago

Kazadri commented 6 months ago

Hi ! Awesome work here ! 🫡 Was searching for an alternative for a basic dataTable and found your bundle :smiley:

Was trying the bundle and when following the documentation to create a simple DataTable, I got an exception :

Unable to create data table without a query. Use the "Kreyu\Bundle\DataTableBundle\DataTableBuilder::setQuery()" method to set a query.

I found the solution easily by adding a blank query builder for the query :+1:

    public function index(Request $request, ProductRepository $productRepository)
    {
        $dataTable = $this->createDataTable(ProductDataTableType::class, $productRepository->createQueryBuilder('product'));
        $dataTable->handleRequest($request);
    }

Should not be a big deal to update this in the documentation :wink: If you want, I've time currently to quickly do a PR !

Kreyu commented 6 months ago

Hey, thank you for the kind words. I've updated the documentation