import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; export default Controller.extend({ subBusinessSegmentData : service(), router: service(), queryParams: ['page', 'perPage', 'sort', 'filter'], page: 1, perPage: 10, filter: null, init() { this._super(...arguments); this.table = { mode: "list", model: "sub-business-segment", columns: [ { name: 'Sub Business Segment Code', key: 'subBusinessSegmentCode', uri: "sub-business-segment.detail", editUri: "sub-business-segment.edit" }, { name: 'Sub Business Segment', key: 'subBusinessSegment', }, { name: 'Business Segment', key: 'businessSegment.businessSegmentCode', }, ] }; }, actions : { deleteRow(data) { let result = confirm('Are you sure want to delete this data?'); if (result) { if (data != null) { this.subBusinessSegmentData.delete(data).then(() => { this.router.transitionTo('sub-business-segment.index'); }); } } }, }, });