ember-table icon indicating copy to clipboard operation
ember-table copied to clipboard

Table does not accept valuePath with dots

Open Valgueiro opened this issue 4 years ago • 2 comments

When trying to render the following table:

  columns = [
    {
      name: "id",
      valuePath: "id",
    },
    {
      name: "value path with dot",
      valuePath: "a.b",
    },
  ];

  rows = [
    { id: 0, "a.b": 2 },
    { id: 1, "a.b": 3 },
  ];
<EmberTable as |t|>
    <t.head @columns={{this.columns}} />

    <t.body @rows={{this.rows}} />
 </EmberTable>

It does not render the values from the column that has a dot (.) on the value path

image

I don't know if this should actually be fixed, but, if not, we can add this on the documentation saying that those are not supported.

Ember Version: 3.17.0 (i've also tested with 3.22 and the same problem happens) EmberTable Version: 3.0.1

Valgueiro avatar Jun 02 '21 12:06 Valgueiro

Not sure if this helps... We're using valuePaths with dots. But we're doing so to point to values within nested objects. So... columns = [ { name: "value path with dot", valuePath: "a.b", }, ];

Works with... rows = [ { id: 0, a: { b: 2} }, { id: 1, a: {b: 3} }, ];

mjzefeldt avatar Jun 03 '21 19:06 mjzefeldt

@mjzefeldt Ohh got it. Yeah in my case the name of the attribute has a dot, so it would not work for us 😞 .

I had to "escape" the valuePaths removing those dots.

Valgueiro avatar Jun 03 '21 19:06 Valgueiro