Part of the state is lost after calling `setRememberState(false)` and then changing a per page limit from the UI
How to reproduce the bug:
-
Install contributte playground
-
Add a
$grid->setRememberState(false)call into theBasicPresenter -
Go to the default view and write down
dainto the Name filter input -
That gives you 54 results, as expected
-
But then change the pagination to 50 items per page
Suddenly you get an unfiltered result (showing all 1000 records) but with the da still in the Name filter input.
Expected behavior would be not loosing the filter state (keeping it in URL) when the user changes items per page parameter.
Could you send a PR? Thanks!
I have some stupid workaround. As datagrid on paging change ignores filter values, I changed action attribute of grid form:
$(document).on('change', 'select[data-autosubmit-per-page]', function () {
return $("#frm-grid-filter").attr("action",location.href);
})
I use this javascipt before loading ublaboo-datagrid/datagrid.js
This works for me with this settings:
$grid->setRememberState(false);
$grid->setRefreshUrl(true);
$grid->setAutoSubmit(true);
I have the same issue here (filters lost after pagination change) even though I am not using $grid->setRememberState(false).
The workaround unfortunately didn't help.
I was trying to find out the root of the problem but still don't know why this is happening. I figured out that the problem occurs when I set setFilterDateRange() filter on some column.
I have the same issue. I am using this configuration.
$this->setStrictSessionFilterValues(false);
$this->setRememberState(true);
$this->setRefreshUrl(false);
$this->setAutoSubmit(false);
Same as @arwin009, problem only occours with combination in setFilterDateRange()
bump