Posted 23 June 2020, 5:46 pm EST - Updated 3 October 2022, 7:04 am EST
Dear Wijmo Team,
I’m rendering grouped columns which basically works fine. But I’m running into an issue where all column headers except the ones from subcolumns become empty after I set a any single comlumn to visible=false.
It’s really difficult to debug as I have no idea where and why this would happen.
Before:
After:
How I set column visible=false:
Click on the blue settings wheel opens a dialog that shows a transfer window with two lists side by side. List on the left contains all visible columns, list on the right contains all invisble columns and is empty by default. Dragging a column from the left to the right lists triggers a function that sets column.visible = false;
What I already found out:
When setting visible to false, the textContent of all affected column cells is empty:
this.flexdata.formatItem.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.FormatItemEventArgs) => {
// Zentrierung Header Gruppen Zellen (Bei FS und AA Gruppierung)
if (e.panel == this.flexdata.columnHeaders) {
console.log("e.cell.textContent: ", e.cell.textContent);
e.cell.innerHTML = '<div>' + e.cell.innerHTML + '</div>';
}
}
But the textContent from the subcolumns isn’t empty. I dont understand that either.
Here’s how I render grouped column cells and normal columns (including sub columns):
Grouped column headers
{
dataType: Datatype[attribute.datentyp],
header: this.getAttributHeader(attribute, columnLevel),
columns: this.calculateSubColumns(attribute),
binding: 'attributWerte.' + attribute.id + '.content',
visible: visible,
format: pattern,
isReadOnly: attribute.isReadOnly,
isRequired: false,
align: GridColumns.GRID_COLUMN_ALIGNMENT_CENTER,
}
Sub columns and regular columns:
{
dataType: Datatype[attribute.datentyp],
header: this.getAttributHeader(attribute, columnLevel),
binding: bindingName,
visible: visible,
format: pattern,
isReadOnly: attribute.isReadOnly,
isRequired: false,
align: align,
};
It has to be something regarding the grouped columns, because when the dataset doesn’t include hierarchical data and the grid therefore only shows regular columns, setting column.visible = false in the dailog works just fine.
Do you have an idea why this happens?
Best regards
Moritz