Kreyu/data-table-bundle

Missing query declaration in documentation

Closed this issue ยท 1 comments

Hi ! Awesome work here ! ๐Ÿซก Was searching for an alternative for a basic dataTable and found your bundle ๐Ÿ˜ƒ

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 ๐Ÿ‘

    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 ๐Ÿ˜‰ If you want, I've time currently to quickly do a PR !

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