Using ember-models-tables


#1

Have anyone used https://github.com/onechiporenko/ember-models-table if yes can you please shoe how to define pass model into the component?


#2

@opoudel, I was working with the same issue. I setup the ember-models-table component in the following way to get it to work:

{{models-table
    data=model
    columns=columns
}}

The model is defined in the associated route. I was having trouble with the columns mapping being recognized in the route, so I created a controller used by the route that contained the columns definitions.

I hope this helps.


#3

@opoudel, if you look at the Demo in the link you provided, there are a few examples of how you would use the component.


#4

I am trying to test the addon, can you elaborate on columns …how did you generate them in the controller you created … from you model definition or just a simple array with names ? thanks


#5

@erwin16:

My columns definition is similar to the following where the propertyName is a model field name and the title is whatever label I want to give to the column header:

columns: [{ “propertyName”: “name”, “title”: “Name” }, { “propertyName”: “description”, “title”: “Description” }, { “propertyName”: “someOtherModelField”, “title”: “Title” }]