paper-datatable icon indicating copy to clipboard operation
paper-datatable copied to clipboard

Allow nested property names

Open xmakro opened this issue 8 years ago • 4 comments

Example:

<paper-datatable-column header="Lastname" property="user.lastname" type="String"></paper-datatable-column>

Should bind to model["user"]["lastname"] for rendering, editing and sorting.

I can do the PR for it if you agree with this.

xmakro avatar Dec 29 '15 11:12 xmakro

Isn't it enough to just use

<paper-datatable-column header="Last name" property="user" [...]>
  <template>
    {{value.lastname}}
  </template>
</paper-datatable-column>

or even

<paper-datatable-column header="Name" property="user" [...]>
  <template>
    {{value.firstname}} {{value.lastname}}
  </template>
</paper-datatable-column>

. So far in my experience when the property is an object in the majority of cases it makes sense to show it in one column per option 2. If it does not however option 1 above is the solution (which I didn't implement explicitly as it seemed the exception rather than the norm).

David-Mulder avatar Dec 29 '15 18:12 David-Mulder

Although if you do think it's worth programming (as it might make sense in combination with [dialog] and a custom <template>) then I will gladly accept a PR. Just make sure to add such a column to both playground.html demo's then (and check they work of course).

David-Mulder avatar Dec 29 '15 18:12 David-Mulder

+1, would be very useful

s-devaney avatar Jan 04 '16 21:01 s-devaney

@David-Mulder Is there a way to use the format-value if using your suggested method of displaying the nested properties?

allenmoatallen avatar Mar 16 '16 13:03 allenmoatallen