adapt event dataProcessed and method autoselect

This commit is contained in:
ma0068
2025-10-08 10:28:14 +02:00
parent 450789ed72
commit 3a6c8dfd2d
@@ -223,9 +223,9 @@ export default {
}, },
{ {
event: 'dataProcessed', event: 'dataProcessed',
//handler: this.autoSelectRows TODO(Manu) combine
handler: (data) => { handler: (data) => {
this.reexpandRows() this.reexpandRows()
this.autoSelectRows()
this.$emit('update:selected', {}) this.$emit('update:selected', {})
} }
}, },
@@ -241,7 +241,7 @@ export default {
event: 'rowClick', event: 'rowClick',
handler: this.handleRowClick // TODO(chris): this should be in the filter component handler: this.handleRowClick // TODO(chris): this should be in the filter component
}, },
/* { {
event: 'dataTreeRowExpanded', event: 'dataTreeRowExpanded',
handler: (data) => { handler: (data) => {
this.getExpandedRows() this.getExpandedRows()
@@ -252,7 +252,7 @@ export default {
handler: (data) => { handler: (data) => {
this.getExpandedRows() this.getExpandedRows()
} }
}*/ }
], ],
focusObj: null, // TODO(chris): this should be in the filter component focusObj: null, // TODO(chris): this should be in the filter component
lastSelected: null, lastSelected: null,
@@ -286,7 +286,7 @@ export default {
this.$emit('update:selected', data); this.$emit('update:selected', data);
}, },
autoSelectRows(data) { autoSelectRows(data) {
if (this.lastSelected) { if (Array.isArray(this.lastSelected) && this.lastSelected.length){
// NOTE(chris): reselect rows on refresh // NOTE(chris): reselect rows on refresh
let selected = this.lastSelected.map(el => this.$refs.table.tabulator.getRow(el.prestudent_id)) let selected = this.lastSelected.map(el => this.$refs.table.tabulator.getRow(el.prestudent_id))
// TODO(chris): unselect current item if it's no longer in the table? // TODO(chris): unselect current item if it's no longer in the table?