fixing bug. issue #869

This commit is contained in:
pablohpsilva 2017-06-26 20:35:46 -03:00
parent 9abe1f242f
commit 482a948885

View file

@ -51,12 +51,15 @@
emitSelection() {
this.$emit('select', this.selectedRows);
},
removeRow(row, array = null) {
const list = array || this.data;
const index = list.indexOf(row);
removeRow(row) {
const index = this.data.indexOf(row);
const selectedIndex = this.selectedRows.indexOf(row);
if (index !== -1) {
list.splice(index, 1);
this.data.splice(index, 1);
}
if (selectedIndex !== -1) {
this.selectedRows.splice(selectedIndex, 1);
}
},
setRowSelection(isSelected, row) {
@ -64,7 +67,7 @@
this.selectedRows.push(row);
return;
}
this.removeRow(row, this.selectedRows);
this.removeRow(row);
},
setMultipleRowSelection(isSelected) {
this.selectedRows = isSelected ?