当我在交易表上添加多于1行并单击“更新”按钮时,两行均变为数量列中的文本输入。当我单击“保存”按钮时,将弹出警报,具体取决于我的交易表中有多少行。我想根据特定行中的用户单击按钮将数量更改为文本输入,然后单击保存按钮时弹出一次。有人可以帮我解决我的问题吗?这是我的jsfiddle-> https://jsfiddle.net/3b71oj4t/7/
toggleTransactionUpdate : function() {
this.updateButtonTransaction = false;
this.saveButtonTransaction = true;
this.disableButtonTransaction = false;
this.enableButtonTransaction = true;
},
updateTransactionCart : function() {
for(var index = 0; index < this.selects.length; index++) {
for(var index1 = 0; index1 < this.lists.length; index1++) {
if(this.lists[index1].id === this.selects[index].id) {
if (this.selects[index].quantity > this.lists[index1].quantity) {
alert('You exceed to maximum quantity');
} else {
this.disableButtonTransaction = true;
this.enableButtonTransaction = false;
this.updateButtonTransaction = true;
this.saveButtonTransaction = false;
alert('Saved Successfully');
}
}
}
}
}