paper-datatable
paper-datatable copied to clipboard
Allow nested property names
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.
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).
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).
+1, would be very useful
@David-Mulder Is there a way to use the format-value
if using your suggested method of displaying the nested properties?