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 66 forks source link

Template-ize table rows #193

Closed teddyward closed 5 years ago

teddyward commented 7 years ago

tl;dr I would like to be able to make a custom component representing a row of an iron-data-table. Is this possible?

Basically, I want to have an edit icon in each row. When clicked, the contents of the row should be replaced with inputs. I can think of at least one way to do this, but ideally a row would be able to manage its own HTML as a component. I have tried many variations on the following where my-row-component contains template info for each data-table-column, to no avail:

<iron-data-table [...]>
  <my-row-component [...]></my-row-component [...]>
</iron-data-table>

Is there any way to achieve something like this with iron-data-table?

Saulis commented 7 years ago

Hi @teddyward!

If I understand you correctly, you're probably looking for something like the CRUD example we've built for <vaadin-grid> 2.0: https://cdn.vaadin.com/vaadin-grid/2.0.0/demo/crud.html

The same approach should work also for <iron-data-table>

Saulis commented 7 years ago

Here's another simple example: https://cdn.vaadin.com/vaadin-grid/2.0.0/demo/index.html#two-way-binding

teddyward commented 5 years ago

two years late, but yes, you are right :p