reload Tables correctly on student change

This commit is contained in:
cgfhtw
2024-07-15 11:39:05 +02:00
parent 9af7ec3ff5
commit 5dbeea80df
3 changed files with 21 additions and 10 deletions
@@ -36,9 +36,11 @@ export default {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.endpoint.getAllBetriebsmittel,
ajaxParams: {
type: this.typeId,
id: this.id
ajaxParams: () => {
return {
type: this.typeId,
id: this.id
};
},
ajaxResponse: (url, params, response) => response.data,
columns: [
@@ -149,7 +151,7 @@ export default {
},
watch: {
id() {
this.$refs.table.tabulator.setData('dummy', {type: this.typeId, id: this.id});
this.$refs.table.reloadTable();
}
},
methods: {
+8 -3
View File
@@ -49,9 +49,11 @@ export default {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.endpoint.getNotizen,
ajaxParams: {
id: this.id,
type: this.typeId
ajaxParams: () => {
return {
id: this.id,
type: this.typeId
};
},
ajaxResponse: (url, params, response) => response.data,
columns: [
@@ -479,6 +481,9 @@ export default {
}
},
deep: true
},
id() {
this.reload();
}
},
beforeDestroy() {
@@ -9,7 +9,6 @@ export default{
prestudentId: Number
},
data() {
let prestudent_id = this.prestudentId;
return {
tabulatorOptions: {
ajaxURL: 'api/frontend/v1/stv/Prestudent/getHistoryPrestudents/' + this.personId,
@@ -26,13 +25,13 @@ export default{
{title:"Status", field:"status"},
{title:"PrestudentId", field:"prestudent_id", visible:false}
],
rowFormatter(row) {
rowFormatter: row => {
const rowData = row.getData();
const element = row.getElement();
if (["Abgewiesener","Abbrecher","Absolvent"].includes(rowData.status_kurzbz)) {
element.classList.add('disabled');
}
if (rowData.prestudent_id == prestudent_id) {
if (rowData.prestudent_id == this.prestudentId) {
element.classList.add('fw-bold');
}
},
@@ -62,6 +61,11 @@ export default{
]
}
},
watch: {
personId() {
this.$refs.table.tabulator.setData('api/frontend/v1/stv/Prestudent/getHistoryPrestudents/' + this.personId);
}
},
template: `
<div class="stv-details-prestudent-history h-100 pt-3">
<core-filter-cmpt