I am using ember-models-table (https://github.com/onechiporenko/ember-models-table) and I want to customize the output of a table cell. As the documentation suggests I tried with assigning templates and components to columns in the columns definition.
import Ember from 'ember';
export default Ember.Controller.extend({
columnDefs
{
"propertyName": "id",
"title": "ID",
},
{
"propertyName": "name",
"title": "Name",
},
{
"propertyName": "postTypeId",
"title": "Post Type",
"template": "ember-models-table/column/enumType", // can be template or component
}
});
So I am not talking about the ember-models-table component but about custom templates / component that can be assigned to specific column as can be seen in column 3 in my code snipplet. Whereas it seems that to a template only a record reference is passed, the docs (http://onechiporenko.github.io/ember-models-table/#/examples) say that to a component a table, a column, a record and a data reference is passed but what I need is
a) the specific value (or model property) I defined within the columnDefs in the controller (this is because I want to use this template / component with many models and different property names, so I can't hardcode the property name in the template / component)
b) the ability to pass arbitrary data to the column's component (here I am talking about component only because it seems that it is possible with components to pass something in with the data attribute, but I could not figure out how to do it)
Hope my problem is getting a little bit clearer and would appreciate every suggestion.
P.S If there's a better way to format the output within a table cell (for example by somehow assigning a helper to the cell's value) please tell me.