mirror of https://github.com/Fabio286/antares.git
fix: multiple row select on sorted tables not work properly
This commit is contained in:
parent
496490b14a
commit
c7663be338
|
@ -408,15 +408,15 @@ export default {
|
||||||
this.selectedRows.push(row);
|
this.selectedRows.push(row);
|
||||||
else {
|
else {
|
||||||
const lastID = this.selectedRows.slice(-1)[0];
|
const lastID = this.selectedRows.slice(-1)[0];
|
||||||
const lastIndex = this.localResults.findIndex(el => el._id === lastID);
|
const lastIndex = this.sortedResults.findIndex(el => el._id === lastID);
|
||||||
const clickedIndex = this.localResults.findIndex(el => el._id === row);
|
const clickedIndex = this.sortedResults.findIndex(el => el._id === row);
|
||||||
if (lastIndex > clickedIndex) {
|
if (lastIndex > clickedIndex) {
|
||||||
for (let i = clickedIndex; i < lastIndex; i++)
|
for (let i = clickedIndex; i < lastIndex; i++)
|
||||||
this.selectedRows.push(this.localResults[i]._id);
|
this.selectedRows.push(this.sortedResults[i]._id);
|
||||||
}
|
}
|
||||||
else if (lastIndex < clickedIndex) {
|
else if (lastIndex < clickedIndex) {
|
||||||
for (let i = clickedIndex; i > lastIndex; i--)
|
for (let i = clickedIndex; i > lastIndex; i--)
|
||||||
this.selectedRows.push(this.localResults[i]._id);
|
this.selectedRows.push(this.sortedResults[i]._id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,6 +435,8 @@ export default {
|
||||||
sort (field) {
|
sort (field) {
|
||||||
if (!this.isSortable) return;
|
if (!this.isSortable) return;
|
||||||
|
|
||||||
|
this.selectedRows = [];
|
||||||
|
|
||||||
if (this.mode === 'query')
|
if (this.mode === 'query')
|
||||||
field = `${this.getTable(this.resultsetIndex)}.${field}`;
|
field = `${this.getTable(this.resultsetIndex)}.${field}`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue