I am not able to create even a basic table using ember-table latest version


#1

https://opensource.addepar.com/ember-table/latest/docs/quickstart I have follwed the above documentatiom but not able to create table. shows error in column definitions. Can anyone show me a complete example of creating basic table. Can someone please give me a example of columns and rows constrcton details.!! I follows the docs but not wotking for me!


#2

I can help a bit, but you haven’t provided much to respond to. “shows error in column definitions” can cover a lot of territory. The quickstart is accurate but limited. The other examples flesh things out a bit more. They show the creation of the data structures for columns and rows. I can attest that these things work, as we used them as a basis for our own implementation. As long as the row property names are specified as the values of the column valuePath properties, everything should fundamentally hold together. Beyond that, it will mostly ignore things it doesn’t understand, rather than fail.

Perhaps you can share a simplified reduction of the column and row structures you are trying to use and how you’re using it in your table template and we can spot where things are going off the rails. This will also help us to discover how to make the documentation clearer.


#3

template.js

import Component from '@ember/component';

class DemoComponent extends Component {
  columns = [
    {
      name: `First Name`,
      valuePath: `firstName`
    },
    {
      name: `Last Name`,
      valuePath: `lastName`
    }
  ];

  rows = [
    {
      firstName: 'MR',
      lastName: 'XXXXX',
    },
    {
      firstName: 'MRS',
      lastName: 'YYYYYY',
    }
  ];
}

Template.hbs

  <EmberTable as |t|>
    <t.head @columns={{columns}} />
    <t.body @rows={{rows}} />
  </EmberTable>

#4

Looks like your template names are not the same, one is capital T the other is lower case, so your ember table @colums has no access to your Columns component in your template.js file.


#6

I have fixed this issue.

Now I am facing below issue while creating a ember-table component.

“Property set failed: object in path “unwrappedApi” could not be found.”


#7

I am facing a similar issue as Omed.

“Property set failed: object in path “unwrappedApi” could not be found.”

Here is more information about my setup:

  1. Using the same code as given on the ember-table web-site.
  2. Ember-table version: “^2.0.0-beta.4”
  3. Ember version: “~3.1.3”

Any help with resolving this is highly appreciated.

Thanks,