APYDataGridBundle icon indicating copy to clipboard operation
APYDataGridBundle copied to clipboard

Pagination and ajax bug

Open vialcollet opened this issue 7 years ago • 4 comments

Hi there I have a weird case with my Pagerfanta pagination. Here are two cases:

Case 1: directly switch to another page The request doesn't appear as an ajax call and therefore my entire page is reloaded.

$request = Request::createFromGlobals();
$ajax = $request->isXmlHttpRequest(); // returns false

Case 2: Use any filter in the grid and then use pagination In this case the pagination call is seen as an ajax request and only my grid is reloaded.

$request = Request::createFromGlobals();
$ajax = $request->isXmlHttpRequest(); // returns true

Is there a missing piece with Pagerfanta?

vialcollet avatar Jun 20 '18 22:06 vialcollet

I found the issue. Filters have events listeners attached to their elements. But Reset button and Pagerfanta are managed by JQuery selectors. As Jquery was loaded in the footer this was causing the issue until the grid is reloaded while Jquery was available.

What could be done in order to avoid this? It's a common practice to load Jquery in the footer.

vialcollet avatar Jun 21 '18 11:06 vialcollet

@vialcollet if you have any idea, feel free to contribute on this project. As you can see, I'm alone here and I have no time to follow this project under this conditions (doing it all by myself seems like a huge mountain to overtake)

DonCallisto avatar Jun 21 '18 11:06 DonCallisto

Well I actually have no idea... :( Let's close for now as this is a very acceptable workaround.

vialcollet avatar Jun 21 '18 15:06 vialcollet

Let’s keep it open, is still an issue

DonCallisto avatar Jun 21 '18 16:06 DonCallisto