I wan to use ember-models-table addon and set the default values for customIcons and customClasses so I have added a component called form-table
app/components/form-table.js
and added the following code to it import modelsTableComponent from 'ember-models-table/components/models-table';
import modelsTableComponent from 'ember-models-table/components/models-table';
export default modelsTableComponent.extend({
didInsertElement: function () {
this._super(...arguments);
this.$().attr('customIcons', Ember.Object.create({
"sort-asc": "fa fa-chevron-down",
"sort-desc": "fa fa-chevron-up",
"column-visible": "fa fa-check-square-o",
"column-hidden": "fa fa-square-o",
"nav-first": "fa fa-chevron-left",
"nav-prev": "fa fa-angle-left",
"nav-next": "fa fa-angle-right",
"nav-last": "fa fa-chevron-right",
"caret": "fa fa-caret-down",
"expand-row": "fa fa-plus",
"collapse-row": "fa fa-minus"
}));
this.$().attr('customClasses', Ember.Object.create({
"clearFilterIcon": "fa fa-times form-control-feedback",
"clearAllFiltersIcon": "fa fa-times-circle-o"
}));
}
});
but when I call
{{form-table
data=table.data
columns=table.columns}}
from the application.hbs under the templates folder and having the following code inside application.hbs under the controller folder I see nothing. And I don't get any error either.
import Ember from 'ember';
export default Ember.Controller.extend({
table: {
data: [
Ember.Object.create({ id: 1, firstName: 'john', lastName: 'Smith', city: "CityA" }),
Ember.Object.create({ id: 1, firstName: 'bob', lastName: 'Smith', city: "CityB" }),
],
columns: [
{
"propertyName": "id",
"title": "ID"
},
{
"propertyName": "firstName",
"title": "First Name"
},
{
"propertyName": "lastName",
"title": "Last Name"
},
{
"propertyName": "city",
"title": "City"
}
]
},
});
Howerver if I replace my code in the application.hbs file from
{{form-table
data=table.data
columns=table.columns}}
to
{{models-table
data=table.data
columns=table.columns}}
everything works. Does that mean I can't extend an add on ?