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

Filtering when value is 0 not working #184

Closed Geoffry304 closed 5 years ago

Geoffry304 commented 6 years ago

Prerequisites

Steps to reproduce the issue

  1. Add a filter with dropdown values yes(1) and no(0)
  2. Select the no value
  3. Save default filter

Expected behavior and actual behavior

When I follow those steps, I see... an empty array and that the value is not saved for the filter

I was expecting... an array and that the value is saved for the filter example Approved = 0

Environment

Browsers

Operating System

Libraries

Isolating the problem

pjalinski commented 6 years ago

Line 1132 $model->data = array_filter($this->gridOptions['filterModel']->attributes);

change to $model->data = array_filter($this->gridOptions['filterModel']->attributes, function($a) {return isset($a);});

Geoffry304 commented 6 years ago

@kartik-v is there a reason why you are not updating this?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.