Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filterAttribute ignored in DataColumn when creating non-standard filters #1064

Closed
12 of 16 tasks
BelegUS opened this issue Apr 28, 2023 · 0 comments
Closed
12 of 16 tasks
Labels

Comments

@BelegUS
Copy link

BelegUS commented Apr 28, 2023

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-grid.
  • 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.

Steps to reproduce the issue

  1. Create some GridView
  2. 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).

Problem's most likely that attribute is passed instead of filterAttribute in DataColumn::renderFilterCellContent():
https://github.com/kartik-v/yii2-grid/blob/master/src/DataColumn.php#L266

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer
  • Safari

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: 3.6.1
  • yii2-grid version: 3.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-grid without other plugins.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants