Saulis / iron-data-table

iron-data-table is a Web Component for displaying data as a table or grid. Built on top of iron-list using Polymer.
Apache License 2.0
147 stars 65 forks source link

Feature Request: Custom-filters #128

Closed rosepriya-jk closed 8 years ago

rosepriya-jk commented 8 years ago

It would be good if there is a custom-filter feature that could be used (instead of the built-in paper-input in the header), which can associate any external element as the filter for iron-data-table. If you think this is a valid request, I shall raise a PR for the same.

Saulis commented 8 years ago

Hi!

This can be done by using header templates and column.filterValue.

<data-table-column name="State" filter-by="user.location.state">
  <template is="header">
    <vaadin-combo-box label="[[column.name]]" value="{{column.filterValue}}" allow-custom-value></vaadin-combo-box> 
  </template>
  <template>[[item.user.location.state]]</template>
</data-table-column>

Please see: http://saulis.github.io/iron-data-table/demo/filtering.html for an example.

rosepriya-jk commented 8 years ago

Hi, If the custom-filter element takes all the filter-parameters together, (like a paper-dialog which has fields for all the filterable columns), then, is there any existing way of doing that in the element?

Saulis commented 8 years ago

Have a look at the filter property, I think thats something you're looking for in that case.