-
Notifications
You must be signed in to change notification settings - Fork 38
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
Allow users to add and remove filters (only one) #40
Comments
There is a Would modifying im-tables to accept the code (e.g. "B") of a constraint to remove be a good way forward for you? I can look at this probably no earlier than mid-july, unfortunately, due to a conference/ |
@yochannah The thing is I'm not sure how to give a code to a constraint using addConstraint, maybe it's useful to remove a constraint by index, like removeConstraint(1) -> removes second constraint. This way I can keep a index per constraint and attach it to the event of selecting one, so when the user removes it I can just delete the associated constraint... what do u think? |
it looks to me like the constraints get automatically appended to the end of the constraints array, but I think it's probably safer to explicitly use the codes. You can set the code when you add the constraint, e.g. table.query.addConstraint({
"path": "goAnnotation.ontologyTerm.name",
"op": "==",
"value": "protein binding",
"code" : "B"
}); |
@yochannah ok! Perfect 👍 |
ok, I was wrong - this is already possible! I'm learning so much about imjs and imtables this GSoC 😆 Demo to remove a constraint: https://yochannah.github.io/im-tables-examples/constraint-remove.html |
@yochannah Wonderful, that's exactly what I need 👍 thanks |
"clear filters" is great, but sometimes a user might want to remove just one of the filters and leave the others intact. Could we have an
x
beside any active filter?The text was updated successfully, but these errors were encountered: