hino / app / controllers / category-uio / index.js
index.js
Raw
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default Controller.extend({
	categoryUioData : service(),
	router: service(),
	queryParams: ['page', 'perPage', 'sort', 'filter'],
	page: 1,
	perPage: 10,
	filter: null,
	init() {
		this._super(...arguments);
		this.table = {
			mode: "list",
			model: "category-uio",
			columns: [
			{
				name: 'Category UIO Code',
				key: 'categoryUioCode',
				uri: "category-uio.detail",
				editUri: "category-uio.edit"
			},
			{
				name: 'Category UIO',
				key: 'categoryUio',
			},
			] 
		};
	},
	actions : {
		deleteRow(data) {
			let result = confirm('Are you sure want to delete this data?');
			if (result) {
				if (data != null) {
					this.categoryUioData.delete(data).then(() => {
						this.router.transitionTo('category-uio.index');
					});
				}
			}
		},
	},
});