mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
fixed timing of initial localization of tabulator collapsed column headings
This commit is contained in:
@@ -24,7 +24,7 @@ Vue.$collapseFormatter = function (data) {
|
|||||||
let item2 = document.createElement("div");
|
let item2 = document.createElement("div");
|
||||||
item2.classList.add("col-6");
|
item2.classList.add("col-6");
|
||||||
|
|
||||||
item.innerHTML = "<strong class=\"collapsedColumnHeading\" field=\"" + col.field + "\">placeholder</strong>";
|
item.innerHTML = "<strong class=\"collapsedColumnHeading\" tabulator-column-field=\"" + col.field + "\">placeholder</strong>";
|
||||||
item2.innerHTML = col.value ? col.value : "-";
|
item2.innerHTML = col.value ? col.value : "-";
|
||||||
|
|
||||||
list.appendChild(item);
|
list.appendChild(item);
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ export const CoreFilterCmpt = {
|
|||||||
this.tabulator.setLocale(newSelectedLanguage);
|
this.tabulator.setLocale(newSelectedLanguage);
|
||||||
|
|
||||||
if (this.$props.tabulatorOptions.responsiveLayoutCollapseFormatter) {
|
if (this.$props.tabulatorOptions.responsiveLayoutCollapseFormatter) {
|
||||||
this.localizeCollapsedColumnHeadings(newSelectedLanguage);
|
this.localizeCollapsedColumnHeadings();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -316,9 +316,6 @@ export const CoreFilterCmpt = {
|
|||||||
this.tabulator.on('tableBuilt', () => {
|
this.tabulator.on('tableBuilt', () => {
|
||||||
this.tableBuilt = true;
|
this.tableBuilt = true;
|
||||||
this.$emit('tableBuilt');
|
this.$emit('tableBuilt');
|
||||||
if (tabulatorOptions.locale && tabulatorOptions.responsiveLayoutCollapseFormatter) {
|
|
||||||
this.localizeCollapsedColumnHeadings();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
this.tabulator.on("rowSelectionChanged", data => {
|
this.tabulator.on("rowSelectionChanged", data => {
|
||||||
this.selectedData = data;
|
this.selectedData = data;
|
||||||
@@ -357,9 +354,6 @@ export const CoreFilterCmpt = {
|
|||||||
this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField());
|
this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField());
|
||||||
if (this.tabulator.options.persistence.headerFilter)
|
if (this.tabulator.options.persistence.headerFilter)
|
||||||
this._setHeaderFilter();
|
this._setHeaderFilter();
|
||||||
if (tabulatorOptions.locale && tabulatorOptions.responsiveLayoutCollapseFormatter) {
|
|
||||||
this.localizeCollapsedColumnHeadings();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -368,6 +362,12 @@ export const CoreFilterCmpt = {
|
|||||||
this.filterActive = filters.length > 0;
|
this.filterActive = filters.length > 0;
|
||||||
this.$emit("headerFilterOn", this.filterActive);
|
this.$emit("headerFilterOn", this.filterActive);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.tabulator.on('renderComplete', () => {
|
||||||
|
if (tabulatorOptions.locale && tabulatorOptions.responsiveLayoutCollapseFormatter && this.tableBuilt) {
|
||||||
|
this.localizeCollapsedColumnHeadings();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
async configureTabulatorLocalizations(tabulatorOptions) {
|
async configureTabulatorLocalizations(tabulatorOptions) {
|
||||||
tabulatorOptions.locale = this.$p.user_language.value;
|
tabulatorOptions.locale = this.$p.user_language.value;
|
||||||
@@ -485,12 +485,14 @@ export const CoreFilterCmpt = {
|
|||||||
return tabulatorOptions;
|
return tabulatorOptions;
|
||||||
},
|
},
|
||||||
async localizeCollapsedColumnHeadings() {
|
async localizeCollapsedColumnHeadings() {
|
||||||
const columnHeadings = this.tabulator.getLang().columns;
|
const columnHeadings = this.tabulator?.getLang()?.columns;
|
||||||
|
if (!columnHeadings) return;
|
||||||
|
|
||||||
this.$refs.table
|
this.$refs.table
|
||||||
.querySelectorAll(".collapsedColumnHeading")
|
.querySelectorAll(".collapsedColumnHeading")
|
||||||
.forEach((collapsedColumnHeadingElement) => {
|
.forEach((collapsedColumnHeadingElement) => {
|
||||||
const field = collapsedColumnHeadingElement.getAttribute("field");
|
const field =
|
||||||
|
collapsedColumnHeadingElement.getAttribute("tabulator-column-field");
|
||||||
if (!field?.length) return;
|
if (!field?.length) return;
|
||||||
|
|
||||||
collapsedColumnHeadingElement.innerHTML =
|
collapsedColumnHeadingElement.innerHTML =
|
||||||
|
|||||||
Reference in New Issue
Block a user