omines / datatables-bundle

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

Datatable return request for data not returning with GET parameters #153

Closed adsazad closed 4 years ago

adsazad commented 4 years ago

I am using datatable. and i added a parameter in url for some work but when datatable returns to url for data it returns without GET parameters. I am also not able to find any function to inject parameters into return request.

curry684 commented 4 years ago

Ok, so what's the issue?

adsazad commented 4 years ago

I have a page /list?status=true and i want to send that same status to the request which come back for data for datatable

curry684 commented 4 years ago

Sorry I still have no idea what you are asking about. Please elaborate, with details on:

adsazad commented 4 years ago

I have a route /admin/list in which i have a optional parameter "status" which makes /admin/list?status=open. Page runs but when it retrives data from from the page it does not send request to the page with the same parameters

MaximePinot commented 4 years ago

Wouldn’t it be better to replace https://github.com/omines/datatables-bundle/blob/ed00d890cc471671b615484d8e2873e3b6a8521e/src/Resources/public/js/datatables.js#L127

by

url: window.location.href
adsazad commented 4 years ago

will this be working for response required by the omines datatable.

curry684 commented 4 years ago

Wouldn’t it be better to replace

https://github.com/omines/datatables-bundle/blob/ed00d890cc471671b615484d8e2873e3b6a8521e/src/Resources/public/js/datatables.js#L127

by

url: window.location.href

They're not equivalent - I wrote it like this specifically to avoid duplicate/conflicting parameters. If the href is somepace?a=b#anchor this would break things spectacularly.