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

Allow nested property names #72

Closed
xmakro opened this issue Dec 29, 2015 · 4 comments · May be fixed by #91
Closed

Allow nested property names #72

xmakro opened this issue Dec 29, 2015 · 4 comments · May be fixed by #91

Comments

@xmakro
Copy link

xmakro commented Dec 29, 2015

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.

@David-Mulder
Copy link
Owner

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
Copy link
Owner

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).

@s-devaney
Copy link

+1, would be very useful

@allenmoatallen
Copy link

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

@xmakro xmakro closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants