mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
update action and delete buttons in Kontakt-Tab
This commit is contained in:
@@ -4,14 +4,6 @@ import PvAutoComplete from "../../../../../../../index.ci.php/public/js/componen
|
||||
import FhcFormValidation from '../../../../Form/Validation.js';
|
||||
import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
|
||||
|
||||
var editIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-edit'></i>";
|
||||
};
|
||||
var deleteIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-remove'></i>";
|
||||
};
|
||||
|
||||
export default{
|
||||
components: {
|
||||
CoreFilterCmpt,
|
||||
@@ -55,12 +47,32 @@ export default{
|
||||
}
|
||||
},
|
||||
{title:"Anmerkung", field:"anmerkung", visible:false},
|
||||
{formatter:editIcon, width:40, align:"center", cellClick: (e, cell) => {
|
||||
this.actionEditAdress(cell.getData().adresse_id);
|
||||
}, width:50, headerSort:false},
|
||||
{formatter:deleteIcon, width:40, align:"center", cellClick: (e, cell) => {
|
||||
this.actionDeleteAdress(cell.getData().adresse_id);
|
||||
}, width:50, headerSort:false },
|
||||
{title: 'Aktionen', field: 'actions',
|
||||
minWidth: 150, // Ensures Action-buttons will be always fully displayed
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-2";
|
||||
|
||||
let button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
button.addEventListener('click', (event) =>
|
||||
this.actionEditAdress(cell.getData().adresse_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-xmark"></i>';
|
||||
button.addEventListener('click', () =>
|
||||
this.actionDeleteAdress(cell.getData().adresse_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
return container;
|
||||
},
|
||||
frozen: true
|
||||
},
|
||||
],
|
||||
layout: 'fitDataFill',
|
||||
layoutColumnsOnNewData: false,
|
||||
|
||||
@@ -2,13 +2,6 @@ import {CoreFilterCmpt} from "../../../../filter/Filter.js";
|
||||
import {CoreRESTClient} from "../../../../../RESTClient";
|
||||
import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
|
||||
var editIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-edit'></i>";
|
||||
};
|
||||
var deleteIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-remove'></i>";
|
||||
};
|
||||
|
||||
export default{
|
||||
components: {
|
||||
CoreFilterCmpt,
|
||||
@@ -50,13 +43,32 @@ export default{
|
||||
},
|
||||
{title:"Person_id", field:"person_id", visible:false},
|
||||
{title:"Bankverbindung_id", field:"bankverbindung_id", visible:false},
|
||||
{formatter:editIcon, width:40, align:"center", cellClick: (e, cell) => {
|
||||
this.actionEditBankverbindung(cell.getData().bankverbindung_id);
|
||||
}, width:50, headerSort:false},
|
||||
{formatter:deleteIcon, width:40, align:"center", cellClick: (e, cell) => {
|
||||
this.actionDeleteBankverbindung(cell.getData().bankverbindung_id);
|
||||
}, width:50, headerSort:false },
|
||||
{title: 'Aktionen', field: 'actions',
|
||||
minWidth: 150, // Ensures Action-buttons will be always fully displayed
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-2";
|
||||
|
||||
let button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
button.addEventListener('click', (event) =>
|
||||
this.actionEditBankverbindung(cell.getData().bankverbindung_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-xmark"></i>';
|
||||
button.addEventListener('click', () =>
|
||||
this.actionDeleteBankverbindung(cell.getData().bankverbindung_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
return container;
|
||||
},
|
||||
frozen: true
|
||||
},
|
||||
],
|
||||
layout: 'fitDataFill',
|
||||
layoutColumnsOnNewData: false,
|
||||
|
||||
@@ -4,13 +4,6 @@ import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
/*import PvToast from "../../../../../../../index.ci.php/public/js/components/primevue/toast/toast.esm.min.js";*/
|
||||
import PvAutoComplete from "../../../../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js";
|
||||
|
||||
var editIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-edit'></i>";
|
||||
};
|
||||
var deleteIcon = function (cell, formatterParams){
|
||||
return "<i class='fa fa-remove'></i>";
|
||||
};
|
||||
|
||||
export default{
|
||||
components: {
|
||||
CoreFilterCmpt,
|
||||
@@ -39,13 +32,32 @@ export default{
|
||||
{title:"Kontakt_id", field:"kontakt_id", visible:false},
|
||||
{title:"Standort_id", field:"standort_id", visible:false},
|
||||
{title:"letzte Änderung", field:"updateamum", visible:false},
|
||||
{formatter:editIcon, cellClick: (e, cell) => {
|
||||
this.actionEditContact(cell.getData().kontakt_id);
|
||||
}, width:50, headerSort:false, headerVisible:false},
|
||||
{formatter:deleteIcon, cellClick: (e, cell) => {
|
||||
this.actionDeleteContact(cell.getData().kontakt_id);
|
||||
{title: 'Aktionen', field: 'actions',
|
||||
minWidth: 150, // Ensures Action-buttons will be always fully displayed
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-2";
|
||||
|
||||
}, width:50, headerSort:false, headerVisible:false},
|
||||
let button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
button.addEventListener('click', (event) =>
|
||||
this.actionEditContact(cell.getData().kontakt_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-xmark"></i>';
|
||||
button.addEventListener('click', () =>
|
||||
this.actionDeleteContact(cell.getData().kontakt_id)
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
return container;
|
||||
},
|
||||
frozen: true
|
||||
},
|
||||
],
|
||||
layout: 'fitDataFill',
|
||||
layoutColumnsOnNewData: false,
|
||||
|
||||
Reference in New Issue
Block a user