kartik-v / yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.
http://demos.krajee.com/dynagrid
Other
74 stars 66 forks source link

Storing filter doesn't run #198

Closed ghpeppe closed 5 years ago

ghpeppe commented 5 years ago

Prerequisites

Steps to reproduce the issue

  1. Set a filter value in a grid column. The filter is applied correctly.
  2. Open the filter dialog, set a name for it and click confirm button.
  3. Reset the grid removing the filter or set another filter criteria.
  4. 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

Operating System

Libraries

Isolating the problem

kartik-v commented 5 years ago

Let me address this in following steps

  1. 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.
  2. 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 show Color = blue.
  3. Personalize dynagrid to open blue books by default: Click the dynagrid personalization wrench settings icon. Select the filter blue books and click apply. Click the Reset Grid toolbar icon. You will see the dynagrid opens a refreshed page with filtered records always defaulting to blue 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.