radiocampus/assets/AFormSet: enable definition of the removeItem method

This commit is contained in:
Chris Tactic 2024-11-18 08:33:34 +01:00
parent f073a9ef77
commit 4f28e884ae

View File

@ -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