diff --git a/source/class/qxl/datagrid/ClippedScrollDataGrid.js b/source/class/qxl/datagrid/ClippedScrollDataGrid.js index be123b0..416e1da 100644 --- a/source/class/qxl/datagrid/ClippedScrollDataGrid.js +++ b/source/class/qxl/datagrid/ClippedScrollDataGrid.js @@ -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(); @@ -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(); + //} } }, diff --git a/source/class/qxl/datagrid/source/tree/TreeDataSource.js b/source/class/qxl/datagrid/source/tree/TreeDataSource.js index 4192cd0..305cac9 100644 --- a/source/class/qxl/datagrid/source/tree/TreeDataSource.js +++ b/source/class/qxl/datagrid/source/tree/TreeDataSource.js @@ -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; @@ -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)); @@ -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; @@ -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; diff --git a/source/class/qxl/datagrid/ui/GridSizeCalculator.js b/source/class/qxl/datagrid/ui/GridSizeCalculator.js index d39054b..218c11f 100644 --- a/source/class/qxl/datagrid/ui/GridSizeCalculator.js +++ b/source/class/qxl/datagrid/ui/GridSizeCalculator.js @@ -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 }; },