[x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
[x] The issue still exists against the latest master branch of yii2-grid.
[x] This is not an usage question. I confirm having gone through and read the documentation and demos.
[x] This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
[x] I have attempted to find the simplest possible steps to reproduce the issue.
Steps to reproduce the issue
Create some GridView
Setup a column with non-standard filterType eg. GridView::FILTER_SELECT_2 and filterAttribute different than this column's attribute
Expected behavior and actual behavior
When I follow those steps, I see that filter input created (eg. input's name) is for attribute value
I was expecting filter input to have filterAttribute used for filter creation (eg. for input's name). That's what filterAttribute is for and it works for "standard" filter types (eg. regular dropdown).
Prerequisites
master
branch of yii2-grid.Steps to reproduce the issue
GridView
filterType
eg.GridView::FILTER_SELECT_2
andfilterAttribute
different than this column'sattribute
Expected behavior and actual behavior
When I follow those steps, I see that filter input created (eg. input's
name
) is forattribute
valueI was expecting filter input to have
filterAttribute
used for filter creation (eg. for input'sname
). That's whatfilterAttribute
is for and it works for "standard" filter types (eg. regular dropdown).Problem's most likely that
attribute
is passed instead offilterAttribute
inDataColumn::renderFilterCellContent()
: https://github.com/kartik-v/yii2-grid/blob/master/src/DataColumn.php#L266Environment
Browsers
Operating System
Libraries
Isolating the problem