-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination - Remove extra query variable from page url #727
Comments
You should use appropriate Request method to detect ajax calls |
Hello!
So I would expect that the ajax variable should not be used by the pagination render method. And indeed if I dump the query params after that, it's not in anymore. I surely miss something. Thx! |
Let me be more clear (sorry but yesterday I replied from my mobile): you should use isXmlHttpRequest method instead of relying on a query parameter. |
I am using fetch for my ajax calls and if I am not wrong, it does not send the needed information for isXMLHttpRequest. |
You just need to use the proper header, something like this: const req = new XMLHttpRequest();
req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
|---------------- | ------
| Bundle version | 5.8.0
| Symfony version | 5.4
| PHP version | 7.4
Hello,
I got a list that I displayed using paginator. Under this list, I have added the pagination using the knp_pagination_render.
After deleting a record in a list, I used an ajax call to regenerate the list and so the pagination. To differenciate this ajax call from a normal one, I used a query variable "ajax". My issue is even if I removed the "ajax" variable from the query, when the pagination is rendered, it does include it, which break the page display when I want to go to another page.
is there a mechanism that would allow me to remove this extra query param from pagination?
thx!
The text was updated successfully, but these errors were encountered: