mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
grid columns display fix
This commit is contained in:
parent
cd7864b889
commit
750a37a27f
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user