Lines 85-98
export default {
Link Here
|
85 |
searchable: false, |
85 |
searchable: false, |
86 |
render: (data, type, row) => { |
86 |
render: (data, type, row) => { |
87 |
let content = [] |
87 |
let content = [] |
88 |
this.actions["-1"].forEach(a => { |
88 |
this.actions["-1"].forEach(action => { |
89 |
if (a == "edit") { |
89 |
if (typeof action === "object") { |
|
|
90 |
let action_name = Object.keys(action)[0] |
91 |
content.push( |
92 |
`<a class="${action_name} btn btn-default btn-xs" role="button"><i class="${action[action_name].icon}"></i>${action[action_name].text}</a>` |
93 |
) |
94 |
} else if (action == "edit") { |
90 |
content.push( |
95 |
content.push( |
91 |
'<a class="edit btn btn-default btn-xs" role="button"><i class="fa fa-pencil"></i>' + |
96 |
'<a class="edit btn btn-default btn-xs" role="button"><i class="fa fa-pencil"></i>' + |
92 |
this.$__("Edit") + |
97 |
this.$__("Edit") + |
93 |
"</a>" |
98 |
"</a>" |
94 |
) |
99 |
) |
95 |
} else if (a == "delete") { |
100 |
} else if (action == "delete") { |
96 |
content.push( |
101 |
content.push( |
97 |
'<a class="delete btn btn-default btn-xs" role="button"><i class="fa fa-trash"></i>' + |
102 |
'<a class="delete btn btn-default btn-xs" role="button"><i class="fa fa-trash"></i>' + |
98 |
this.$__("Delete") + |
103 |
this.$__("Delete") + |
Lines 157-164
export default {
Link Here
|
157 |
.each(function (idx) { |
162 |
.each(function (idx) { |
158 |
const data = dataSet[idx] |
163 |
const data = dataSet[idx] |
159 |
actions.forEach(action => { |
164 |
actions.forEach(action => { |
160 |
$("." + action, this).on("click", e => { |
165 |
let action_name = |
161 |
self.$emit(action, data, dt, e) |
166 |
typeof action === "object" |
|
|
167 |
? Object.keys(action)[0] |
168 |
: action |
169 |
$("." + action_name, this).on("click", e => { |
170 |
self.$emit(action_name, data, dt, e) |
162 |
}) |
171 |
}) |
163 |
}) |
172 |
}) |
164 |
}) |
173 |
}) |
165 |
- |
|
|