Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
johnspackman committed Oct 22, 2024
1 parent fe4f2ed commit 308fecf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
27 changes: 17 additions & 10 deletions source/class/qxl/datagrid/ClippedScrollDataGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,15 @@ qx.Class.define("qxl.datagrid.ClippedScrollDataGrid", {
scrollbarX.show();
} /* === "auto" */ else {
this.scrollByX(0);
if (scrollbarX.getMaximum() > 0) {
scrollbarX.show();
} else {
scrollbarX.exclude();
}

/*
* NOTE: Scrollbar auto does not work, it can create a race condition where it toggles on and off
*/
//if (scrollbarX.getMaximum() > 0) {
scrollbarX.show();
//} else {
// scrollbarX.exclude();
// }
}

let scrollY = this.getScrollbarY();
Expand All @@ -273,11 +277,14 @@ qx.Class.define("qxl.datagrid.ClippedScrollDataGrid", {
scrollbarY.show();
} /* === "auto" */ else {
this.scrollByY(0);
if (scrollbarY.getMaximum() > 0) {
scrollbarY.show();
} else {
scrollbarY.exclude();
}
/*
* NOTE: Scrollbar auto does not work, it can create a race condition where it toggles on and off
*/
//if (scrollbarY.getMaximum() > 0) {
scrollbarY.show();
//} else {
// scrollbarY.exclude();
//}
}
},

Expand Down
12 changes: 8 additions & 4 deletions source/class/qxl/datagrid/source/tree/TreeDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ qx.Class.define("qxl.datagrid.source.tree.TreeDataSource", {
let children = await inspector.getChildrenOf(node);
let rowMeta = this._getNodeMetaData(node);
if (!rowMeta) {
throw new Error(`Cannot find ${node} in rows`);
this.error(`Cannot find ${node} in rows`);
return null;
}
if (rowMeta.childRowMetas || !rowMeta.canHaveChildren) {
return;
Expand Down Expand Up @@ -264,7 +265,8 @@ qx.Class.define("qxl.datagrid.source.tree.TreeDataSource", {
await this.queue(async () => {
let ancestors = await getPathToNode(node);
if (!ancestors) {
throw new Error("Cannot find node in tree");
this.error("Cannot find node in tree");
return;
}
for (var a = 0; a < ancestors.length; a++) {
await this._expandNode(ancestors.getItem(a));
Expand Down Expand Up @@ -293,7 +295,8 @@ qx.Class.define("qxl.datagrid.source.tree.TreeDataSource", {
async _collapseNode(node) {
let rowMeta = this._getNodeMetaData(node);
if (!rowMeta) {
throw new Error(`Cannot find ${node} in rows`);
this.warn(`Cannot find ${node} in rows`);
return;
}
if (!rowMeta.childRowMetas) {
return;
Expand Down Expand Up @@ -461,7 +464,8 @@ qx.Class.define("qxl.datagrid.source.tree.TreeDataSource", {
getParentOf(node) {
let meta = this.__rowMetaDataByNode[node.toHashCode()];
if (!meta) {
throw new Error("Cannot get parent of node. Node is not displayed in tree.");
this.error("Cannot get parent of node. Node is not displayed in tree.");
return null;
}

return meta.parentMeta?.node ?? null;
Expand Down
16 changes: 10 additions & 6 deletions source/class/qxl/datagrid/ui/GridSizeCalculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,18 @@ qx.Class.define("qxl.datagrid.ui.GridSizeCalculator", {
let height = 0;
if (sizes) {
let colCount = styling.getNumFixedColumns();
for (let i = 0; i < colCount; i++) {
width += sizes.columns[i].width;
if (colCount > 0) {
for (let i = 0; i < colCount; i++) {
width += sizes.columns[i].width;
}
width += styling.getHorizontalSpacing() * (colCount - 1);
}
width += styling.getHorizontalSpacing() * (colCount - 1);
for (let row of sizes.rows) {
height += row.height;
if (sizes.rows.length > 0) {
for (let row of sizes.rows) {
height += row.height;
}
height += styling.getVerticalSpacing() * (sizes.rows.length - 1);
}
height += styling.getVerticalSpacing() * (sizes.rows.length - 1);
}
return { width, height };
},
Expand Down

0 comments on commit 308fecf

Please sign in to comment.