Updated Shipping Note
This commit is contained in:
@@ -29,7 +29,7 @@ Vue.component('tt-table-crud', {
|
||||
<template v-slot:actions="{ row }">
|
||||
<!-- calculate min width 1 + number of actions * 19 -->
|
||||
<div style="display: flex; justify-content: space-around; align-items: center;"
|
||||
:style="{minWidth: (1 + crudConfig?.additionalActions?.length || 0) * 19 + 'px'}">
|
||||
:style="{minWidth: calculateMinActionsWidth(row)}">
|
||||
<a style="cursor: pointer;" @click="openCrudModal(row)"><i class="far fa-edit text-primary"
|
||||
title="Editieren"></i></a>
|
||||
|
||||
@@ -154,6 +154,22 @@ Vue.component('tt-table-crud', {
|
||||
}
|
||||
|
||||
this.$set(this, 'crudModalColumnVisibility', crudModalColumnVisibility)
|
||||
},
|
||||
calculateMinActionsWidth(row) {
|
||||
// Base width for the edit action
|
||||
let minWidth = 19;
|
||||
|
||||
// Check additional actions
|
||||
if (this.crudConfig && this.crudConfig.additionalActions) {
|
||||
this.crudConfig.additionalActions.forEach(action => {
|
||||
// Add width if action is visible (no condition or condition is true)
|
||||
if (!action.condition || action.condition(row)) {
|
||||
minWidth += 19;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return `${minWidth}px`;
|
||||
}
|
||||
}, computed: {
|
||||
tableConfig() {
|
||||
|
||||
Reference in New Issue
Block a user