Missing query declaration in documentation
Closed this issue ยท 1 comments
Kazadri commented
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 !
Kreyu commented
Hey, thank you for the kind words. I've updated the documentation