diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 66b52439c..2ae004c9f 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -20,6 +20,10 @@ } +.tabulator-col{ + justify-content:center !important; +} + .tabulator-responsive-collapse{ padding:0 !important; } diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 27b6bb9b1..0db26f157 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -1,7 +1,10 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - +let customEvents = [{event: "headerClick", handler:function(e,column){ + console.log(e); + console.log(column); +}}] export default { @@ -11,9 +14,9 @@ export default { data() { return { - + showCollapsedColumn: true, funktionen_table_options: { - height:400, + height:300, layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, @@ -29,14 +32,15 @@ export default { ], columns: [ //? option when wanting to hide the collapsed list - /* + { - title: "", - field: "", + title: "", + field: "collapse", headerSort: false, + headerFilter:false, formatter:"responsiveCollapse", maxWidth:20, - }, */ + }, { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, { title: "Organisationseinheit", @@ -115,7 +119,8 @@ export default { return { Allgemein: { - + + View:"MitarbeiterIn", Username: this.data.username, Anrede: this.data.anrede, Titel: this.data.titel, @@ -159,10 +164,48 @@ export default { this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + }) + + + this.$refs.funktionenTable.tabulator.on("headerClick", function(e, column){ + this.showCollapsedColumn = !this.showCollapsedColumn; + + if(column._column.field == "collapse"){ + //* changes the icon that shows or hides all the collapsed columns + if(this.showCollapsedColumn){ + document.getElementById("collapseIcon").classList.replace("fa-angle-up","fa-angle-down"); + }else{ + document.getElementById("collapseIcon").classList.replace("fa-angle-down","fa-angle-up"); + } + + //* changes the icon for every collapsed column to open or closed + [...document.getElementsByClassName("tabulator-responsive-collapse-toggle")].forEach(ele => { + if(this.showCollapsedColumn){ + ele.classList.replace("close","open"); + + }else{ + ele.classList.replace("open","close"); + } + }); + + //* hides or shows the collapsed columns + [...document.getElementsByClassName("tabulator-responsive-collapse")].forEach(ele => { + if(this.showCollapsedColumn){ + ele.style.display="" + + }else{ + ele.style.display="none" + } + + }); + + } + + }); }, @@ -177,10 +220,10 @@ export default {
- + Quick links @@ -207,7 +250,7 @@ export default {
Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier
Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier