diff --git a/radiocampus/assets/src/components/AFormSet.vue b/radiocampus/assets/src/components/AFormSet.vue index 7121550..89ce78e 100644 --- a/radiocampus/assets/src/components/AFormSet.vue +++ b/radiocampus/assets/src/components/AFormSet.vue @@ -108,6 +108,7 @@ //! If provided call this function instead of adding an item to rows on "+" button click. actionAdd: Function, + actionRemove: Function, //! If True, columns can be reordered columnsOrderable: Boolean, @@ -161,14 +162,12 @@ this.$emit('move', {...event, seĊ§: set_}) }, - removeItem(row) { - const item = this.items[row] - if(item.id) { - // TODO - } - else { - this.items.splice(row,1) + removeItem(row, item) { + if(this.actionRemove) { + this.actionRemove(row, item); + return } + this.items.splice(row,1) }, //! Load items into set