I didn't get that whats wrong with the code,GET response is diplayed in browser console but its is not display on Table. Please suggest me any changes.Same code use by adapter in other screen it display properly. And in console of web browser [screenshots of web console][1]
Template
<div class="row">
<div class="col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Services
<span class="pull-right">
Import Excel
<button class="btn btn-primary btn-sm">
Create New Service
</button>
</span>
</h3>
</div>
<div class="panel-footer">
<small>List of all the <strong>Services</strong></small>
</div>
</div>
</div>
controller:
import Ember from 'ember';
import ModelListSource from
'app/modules/data-source/model-list- source';
import Table from 'app/modules/table/table';
export default Ember.ArrayController.extend({
servicesTable: Table.TM.create({
paginateFooter: true,
cssClass: "table table-stripped flat-table no-margin",
columns: [
Table.GeneralColumn.create({label: 'Name', name: 'name'}),
Table.GeneralColumn.create({label: 'Description', name: 'description'}),
Table.GeneralColumn.create({label: 'Default Price', name: 'mrp'}),
Table.GeneralColumn.create({label: 'Category', name: 'productCategory.name'}),
Table.GeneralColumn.create({label: 'Department', name: 'department.name'}),
Table.GeneralColumn.create({label: 'Validity Days', name: 'validityDays'}),
Table.ControlColumn.create({
controls: [
Table.EditButton.create({
formMetaName: 'service-form-meta',
params: {
model: '$record'
},
permission: "canManageProductMaster"
}),
Table.DeleteButton.create({
params: {
model: '$record'
},
permission: "canManageProductMaster"
}),
Table.CustomButton.extend({
clickAction: function(record){
this.transitionToRoute('master.services.view', record.get('id'));
}.bind(this)
}).create({
text: "VIEW"
}),
Table.CustomButton.extend({
clickAction: function(record){
this.transitionToRoute('master.services.report', record.get('id'));
}.bind(this)
}).create({
params: {
model: '$record'
},
permission: "canManageProductMaster",
text: "REPORT FORMATS"
})
]
})
]
}),
serviceFormParams: function(){
var model = this.get('model');
return {
callback: function(service){
service.loadData();
}
}
}.property()
});
route:
import Ember from 'ember';
import ModelListSource from 'app/modules/data-source/model-list-source';
export default Ember.Route.extend({
model:function() {
return ModelListSource.create({
model: 'health-care-service',
store: this.store,
paginate: true,
perPage: 10,
currentPage: 1
});
}
});
Aucun commentaire:
Enregistrer un commentaire