-
Notifications
You must be signed in to change notification settings - Fork 754
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
Filter Widget: Pass row to filter functions. #367
Comments
The JQuery object for the row is passed to the format functions as 5th argument.
before I accept this, WHY? all you are doing is passing more data making the heap larger but to what advantage since it's never used. |
The reason I needed it was because I had a filter that didn't directly relate to the column contents. I was filtering a list of products. The filter I wanted was on the class of product rather than individual product name. The class of product was available as a data-* attribute available on the row, but not in the product name cell itself and there wasn't a class column. By passing in the Row, I was able to have the product name filter function extract that detail from the row as a whole. The existing parameters could only tell me about the cell contents, or its number. |
Add row as parameter to the format function calls #367
All merged! Thanks for helping out! |
Currently filter functions only receive details of the cell on which they are filtering. By passing the row it means that he function can reference other table data.
This should only require an extension to the two calls to the format functions in findRows in format in jquery.tablesorter.widgets
This can be achieved by passing the Row's JQuery object $tr.eq(j) as a new 5th parameter
The text was updated successfully, but these errors were encountered: