@@ -, +, @@ --- .../prog/js/vue/components/KohaTable.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue +++ a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue @@ -85,14 +85,19 @@ export default { searchable: false, render: (data, type, row) => { let content = [] - this.actions["-1"].forEach(a => { - if (a == "edit") { + this.actions["-1"].forEach(action => { + if (typeof action === "object") { + let action_name = Object.keys(action)[0] + content.push( + `${action[action_name].text}` + ) + } else if (action == "edit") { content.push( '' + this.$__("Edit") + "" ) - } else if (a == "delete") { + } else if (action == "delete") { content.push( '' + this.$__("Delete") + @@ -157,8 +162,12 @@ export default { .each(function (idx) { const data = dataSet[idx] actions.forEach(action => { - $("." + action, this).on("click", e => { - self.$emit(action, data, dt, e) + let action_name = + typeof action === "object" + ? Object.keys(action)[0] + : action + $("." + action_name, this).on("click", e => { + self.$emit(action_name, data, dt, e) }) }) }) --