grid columns display fix

This commit is contained in:
Jan Prochazka 2022-03-13 11:35:04 +01:00
parent cd7864b889
commit 750a37a27f
4 changed files with 10 additions and 1 deletions

View File

@ -166,11 +166,12 @@ export abstract class GridDisplay {
hideAllColumns() {
this.setConfig(cfg => ({
...cfg,
hiddenColumns: this.columns.map(x => x.uniqueName),
hiddenColumns: this.columns.filter(x => x.uniquePath.length == 1).map(x => x.uniqueName),
}));
}
get hiddenColumnIndexes() {
// console.log('GridDisplay.hiddenColumn', this.config.hiddenColumns);
return (this.config.hiddenColumns || []).map(x => _.findIndex(this.allColumns, y => y.uniqueName == x));
}

View File

@ -800,6 +800,7 @@
// $: console.log('containerHeight', containerHeight);
// $: console.log('COLUMNS', columns);
// $: console.log('columnSizes.realCount', columnSizes.realCount);
// $: console.log('realColumnUniqueNames', realColumnUniqueNames);
// $: console.log('columnSizes.realCount', columnSizes.realCount);

View File

@ -99,9 +99,12 @@ export class SeriesSizes {
}
this.modelIndexes = _.range(0, this.count);
// console.log('SeriesSize:build:this.modelIndexes-before', this.modelIndexes);
// console.log('SeriesSize:build:this.hiddenAndFrozenModelIndexes', this.hiddenAndFrozenModelIndexes);
if (this.hiddenAndFrozenModelIndexes) {
this.modelIndexes = this.modelIndexes.filter(col => !this.hiddenAndFrozenModelIndexes.includes(col));
}
// console.log('SeriesSize:build:this.modelIndexes-result', this.modelIndexes);
}
public getScrollIndexOnPosition(position: number): number {

View File

@ -17,6 +17,7 @@ export function countColumnSizes(grider: Grider, columns, containerWidth, displa
//return this.context.measureText(txt).width;
// console.log('countColumnSizes', loadedRows.length, containerWidth);
// console.log('countColumnSizes:columns', columns);
columnSizes.maxSize = (containerWidth * 2) / 3;
columnSizes.count = columns.length;
@ -114,10 +115,12 @@ export function countVisibleRealColumns(columnSizes, firstVisibleColumnScrollInd
) {
visibleRealColumnIndexes.push(colIndex + columnSizes.frozenCount);
}
// console.log('countVisibleRealColumns:visibleRealColumnIndexes', visibleRealColumnIndexes);
// real columns
for (let colIndex of visibleRealColumnIndexes) {
let modelColumnIndex = columnSizes.realToModel(colIndex);
// console.log('countVisibleRealColumns:modelColumnIndex', modelColumnIndex);
modelIndexes[colIndex] = modelColumnIndex;
let col = columns[modelColumnIndex];
@ -129,6 +132,7 @@ export function countVisibleRealColumns(columnSizes, firstVisibleColumnScrollInd
width,
});
}
// console.log('countVisibleRealColumns:realColumns', realColumns);
return realColumns;
}