diff --git a/packages/datalib/src/GridDisplay.ts b/packages/datalib/src/GridDisplay.ts index fa5e5a23..f03e9441 100644 --- a/packages/datalib/src/GridDisplay.ts +++ b/packages/datalib/src/GridDisplay.ts @@ -150,6 +150,7 @@ export abstract class GridDisplay { select.columns.push({ exprType: 'column', columnName: column.columnName, + alias: column.uniqueName, source: { name: column, alias: parentAlias }, }); res = 'refAdded'; @@ -232,7 +233,7 @@ export abstract class GridDisplay { select.columns.push({ exprType: 'column', columnName: hintColumn.columnName, - alias: `hint_${column.columnName}`, + alias: `hint_${column.uniqueName}`, source: { alias: childAlias }, }); res = 'refAdded'; @@ -252,7 +253,7 @@ export abstract class GridDisplay { ?.map(col => ({ ...col, isChecked: this.isColumnChecked(col), - hintColumnName: col.foreignKey ? `hint_${col.columnName}` : null, + hintColumnName: col.foreignKey ? `hint_${col.uniqueName}` : null, })); } diff --git a/packages/web/src/datagrid/DataGridCore.js b/packages/web/src/datagrid/DataGridCore.js index 02813de6..14969ae1 100644 --- a/packages/web/src/datagrid/DataGridCore.js +++ b/packages/web/src/datagrid/DataGridCore.js @@ -168,6 +168,7 @@ export default function DataGridCore(props) { React.useEffect(() => { if (!isLoadedAll && firstVisibleRowScrollIndex + visibleRowCountUpperBound >= loadedRows.length) { const sql = display.getPageQuery(0, 1); + // try to get SQL, if success, load page. If not, callbacks to load missing metadata are dispatched if (sql) loadNextData(); } if (display.cache.refreshTime > loadedTime) { @@ -300,7 +301,7 @@ export default function DataGridCore(props) { {realColumns.map(col => ( @@ -315,10 +316,10 @@ export default function DataGridCore(props) { {realColumns.map(col => ( - {row[col.columnName]} + {row[col.uniqueName]} {col.hintColumnName && {row[col.hintColumnName]}} ))}