AJAX request with invalidateControl responds with the whole page

5 years ago

Member | 41

I updated to current dev versions of Nette and nextras/datagrid and sorting and filters in my grids stopped working (they worked before!). The handleSort method from datagrid is correctly called and there the invalidateControl is invoked yet the server then responds with the whole page instead of just the snippet to be redrawn.

Any ideas how to debug and fix this? Thank you

It turns out that the response with the whole page has “Cannot send headers” error at the bottom caused by attempt to set content-type to application/json. Also if I put die; here https://api.nette.org/…ion.php.html#150 (line 150) the page is in the response (without the error obviously) – how can the presenter already create output if just snippets could be sent? Only option which comes to my mind is that I should use terminate (to create exception and skip the output part of presenter) right after invoking invalidateControl but that doesn't seem right (and doesn't work anyway).

EDIT2: This is probably an issue with Nette https://github.com/…/issues/1498

Last edited by OndrejSlamecka (2014-05-31 12:17)