-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feature Request: Ability to filter on arbitrary data #174
Comments
Alternatively, being able to filter on arbitrary data or pass in a |
Hey there, sorry for the delay in response. I'm a little nervous about adding a 'hidden' field to the column because there's already an idea of just not including the column if you want it to be hidden, and then this adds some overhead to the table itself now. It's a small amount of overhead, but still. I do like the idea of the filterfunc which gets passed each row individually to allow more fine grained control of filtering. I would expect the filterfunc to be applicable to the table as a whole, and if it exists, then each row is checked on the filterfunc rather than the current standard behavior. It seems potentially useful if we can attach it to the columns as well, but I think the real benefit would be if we attach it to the table as a whole. It should then also have a way to restore standard filtering, maybe just passing nil as the filterfunc being documented as a way to do that is enough. |
I've added the hidden column functionality to the PR I made, but I can work around that feature if I add the I'll mess around with that later today |
Just to make sure we're on the same page, I think your idea of |
Yup, I'm gonna remove the |
Hi @trevorstarick just checking if you were able to take another look at this? |
I've updated my PR. I'm still missing tests with the |
Hi,
I'm looking at implementing some functionality for filtering on arbitrary data. Right now I'm looking at the ability to filter on stuff like "is the docker container in the table online, what is it's state, etc..." but without having that data visible to the end user.
My first idea was somehow hiding the column completely, but couldn't find the ability to do that; so my next idea was implementing a system to filter on metadata passed in the row (the extra stuff that doesn't end up in a column) but I didn't think that that was possible either.
So I'm planning on adding the functionality via a PR but wanted to open up a discussion first before going off and implementing the feature. My plan is to add a
WithHidden(bool)
method to thetable.Column
which will just handle it's inclusion in width calculation (consider the width to be zero) and cause it not to be rendered.The text was updated successfully, but these errors were encountered: