You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if the data table component supports sorting embedded schema fields. I have an embedded schema called "metrics" and want make its fields be sortable in a table called "assets". If not, then I think it would cool to have the sortable attribute to have the option to accept an embedded field name for example sortable={:embedded_field_name}
defmoduleMetricsdouseEcto.Schemaembedded_schemadofield:cost_basis,:float,default: 0.0field:value,:float,default: 0.0field:capital_gain,:float,default: 0.0endenddefmoduleAssetsdoschema"assets"doembeds_one(:metrics,Metrics)timestamps()endend<.data_table:if={@index_params} meta={@meta} items={@assets}><:if_empty>No assets found</:if_empty><:colfield={:label} sortable /># if sortable does not support embedded schema, then sortable={:embedded_field_name} would be cool to support this syntax
<:col:let={asset} field={:metrics}sortable={:cost_basis}>
<%=asset.metrics.cost_basis%></:col></.data_table>
The text was updated successfully, but these errors were encountered:
Sorry my head is deep in another topic at the moment so I'm not sure off the top of my head. We use https://github.com/woylie/flop underneath - so if you can find a way for that to filter by embedded schema fields, then I can better answer how to replicate in our data table.
I was wondering if the data table component supports sorting embedded schema fields. I have an embedded schema called "metrics" and want make its fields be sortable in a table called "assets". If not, then I think it would cool to have the sortable attribute to have the option to accept an embedded field name for example
sortable={:embedded_field_name}
The text was updated successfully, but these errors were encountered: