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

Add support for tags in filters #3

Closed
amir-hadzic opened this issue Nov 1, 2016 · 7 comments
Closed

Add support for tags in filters #3

amir-hadzic opened this issue Nov 1, 2016 · 7 comments

Comments

@amir-hadzic
Copy link
Contributor

User must be able to filter the table by selecting predefined tags in the filter. By default, the tags must be generated from the provided data by taking unique values for each column that is marked as taggable.

The tags must be auto-completed while user is typing, and the tags should be displayed in the form of "ColumnName:TagValue".

  • User must still be able to use the filter for free form text search.
  • Developer must specify that a column is taggable by setting taggable: true in the column definition.
  • Developer must be able to programmatically add or remove tags from the filter.
  • Developer should be able to override the available tags for each column by defining tags: ['value1', 'value2'] in the column definition.
  • Developer should be able to provide a class name for each distinct tag value so it's possible to customize how the tag is displayed in the filter dropdown.
@otisg
Copy link
Member

otisg commented Nov 1, 2016

"taggable" may not be the most intuitive word choice here. It implies one can add tags, but this is really about filtering by column value, not tagging. Unfortunately, don't have a better suggestion right now.

@amir-hadzic
Copy link
Contributor Author

Yeah, I'm bugged by it as well. I'll think about other naming options when I'm done with the implementation.

@mbonaci
Copy link
Member

mbonaci commented Nov 1, 2016

In the jQuery world, they used to call those tags tokens, but maybe that makes even less sense, esp. in our context.
Perhaps more useful name would be pill (column-pills), which is what Bootstrap calls tags that are rounded.
After looking at all these options, to me column-tags still sounds best.

@otisg
Copy link
Member

otisg commented Nov 1, 2016

This is about filtering by column value, so filterable would be a better name.

@amir-hadzic
Copy link
Contributor Author

We already have filterable: true|false for the text filter. So maybe we should have textFilterable, and valueFilterable?

@otisg
Copy link
Member

otisg commented Nov 1, 2016

I assumed the existing option was more about "search", because the matching is a little lose (any substring, right?), while "filter" could imply "exact match".

I was going to suggest an alternative -- suggestible -- but that actually means "easily influenced" in English. My thinking was that columns marked as such would be the ones that can be suggested in the filter field...
Maybe just "suggest: true | false"?

amir-hadzic added a commit that referenced this issue Nov 2, 2016
Also rename:
  values -> filterValues,
  getValueTitle -> getFilterTitle,
  getValueLabel -> getFilterLabel,
  getValueClassName -> getFilterClassName
@amir-hadzic
Copy link
Contributor Author

Ok, I've made some changes, and we now use:

  • searchable: true|false to indicate that a column should be searchable by text
  • filterable: true|false to indicate that a column should be filterable by distinct column values
  • filterValues: [v1, v2] to optionally provide predefined list of column values (by default we take unique values from available data)
  • getFilterTitle: func(value) to optionally provide a function for returning title text that should be shown when related filter option is hovered (no title by default)
  • getFilterLabel: func(value) to optionally provide the label text we should use for the provided filter value (by default we use columnName:columnValue)
  • getFilterClassName: func(value) to optionally provide a css class that should be applied to filter option for the provided filter value

amir-hadzic added a commit that referenced this issue Nov 2, 2016
Also rename:
  values -> filterValues,
  getValueTitle -> getFilterTitle,
  getValueLabel -> getFilterLabel,
  getValueClassName -> getFilterClassName
amir-hadzic added a commit that referenced this issue Nov 2, 2016
Also rename:
  values -> filterValues,
  getValueTitle -> getFilterTitle,
  getValueLabel -> getFilterLabel,
  getValueClassName -> getFilterClassName
amir-hadzic added a commit that referenced this issue Nov 2, 2016
amir-hadzic added a commit that referenced this issue Nov 2, 2016
[#3] Add support for tags in filters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants