Storing filter doesn't run
ghpeppe opened this issue · 1 comments
ghpeppe commented
Prerequisites
- I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- The issue still exists against the latest
master
branch of yii2-dynagrid. - This is not an usage question. I confirm having gone through and read the documentation and demos.
- This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
- I have attempted to find the simplest possible steps to reproduce the issue.
- I have included a failing test as a pull request (Optional).
Steps to reproduce the issue
- Set a filter value in a grid column. The filter is applied correctly.
- Open the filter dialog, set a name for it and click confirm button.
- Reset the grid removing the filter or set another filter criteria.
- Open the filter dialog (or the personalization dialog, it's the same), select the name and click confirm button. Nothing happens.
Expected behavior and actual behavior
The filter setting are stored correctly but they can't be restored. This happens in my application and in the demo too.
The same happens for the sorting criteria.
Environment
Browsers
- Google Chrome
- Mozilla Firefox
- Internet Explorer
- Safari
Operating System
- Windows
- Mac OS X
- Linux
- Mobile
Libraries
- jQuery version:
- yii2-dynagrid version: 1.5.0
Isolating the problem
- This bug happens on the demos page
- The bug happens consistently across all tested browsers
- This bug happens when using yii2-dynagrid without other plugins.
kartik-v commented
Let me address this in following steps
- Creating/Saving a filter: Let us say you wish to create a filter for blue books. On the dynagrid demo page go to the color filter and select the color blue and press tab. You should see only blue books filtered in the grid. Click on the toolbar dynagrid filter icon - and save the filter as
blue books
. - Checking the saved filter: Open the filter icon again. Click the
blue books
filter to see the filter setting and verify it is fine. It should showColor = blue
. - Personalize dynagrid to open blue books by default: Click the dynagrid personalization wrench settings icon. Select the filter
blue books
and click apply. Click theReset Grid
toolbar icon. You will see the dynagrid opens a refreshed page with filtered records always defaulting toblue books
. From next time after this refresh onwards whenever you personalize dynagrid you can see the changed settings on applying them.
Currently there are limitations on the size for session/cookie based storage (hence user level saving is not there yet). But it is quite possible to achieve this with database storage with a different enhancement. Try setting your dynagrid storage to database and it will be better for large data. However, user level storage settings need to be an entirely separate enhancement.
Am closing this issue - and will take it up with your other proposed issue #199 at a later time.