omines / datatables-bundle

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

Pass along query parameters when performing the datatable ajax request #304

Closed dovereem closed 12 months ago

dovereem commented 1 year ago

I needed a way to limit the dataset based on filters set by my end-user.

Currently there does not seem to be a simple way to pass along data that is also picked up and send as POST data with the AJAX request.

As a workaround I figured I'd just to set the filters as a get/query parameter but querystring is not being passed to ajax neither. Currently the ajax url is constructed as window.location.origin + window.location.pathname.

Adding + window.location.search adds the querystring which then can be picked up in the controller to do with as one wishes (ie. filter the result set).

curry684 commented 12 months ago

I agree this is a more meaningful default.