hino / app / controllers / function-info / index.js
index.js
Raw
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default Controller.extend({
	functionInfoData : service(),
	router: service(),
	queryParams: ['page', 'perPage', 'sort', 'filter'],
	page: 1,
	perPage: 10,
	filter: null,
	init() {
		this._super(...arguments);
		this.table = {
			mode: "list",
			model: "function-info",
			columns: [
			{
				name: 'Name',
				key: 'name',
				uri: "function-info.detail",
				editUri: "function-info.edit"
			},
			{
				name: 'Sequence',
				key: 'sequence',
			},
			{
				name: 'URL',
				key: 'url',
			},
			{
				name: 'Module Id',
				key: 'moduleId',
			},
			{
				name: 'Is Show',
				key: 'isShow',
			},
			{
				name: 'Is Enabled',
				key: 'isEnabled',
			},
			] 
		};
	},
	actions : {
		deleteRow(data) {
			let result = confirm('Are you sure want to delete this data?');
			if (result) {
				if (data != null) {
					this.functionInfoData.delete(data).then(() => {
						this.router.transitionTo('function-info.index');
					});
				}
			}
		},
	},
});