Conversation
common/changes/@itwin/viewer-react/leck-ecsql-widget_2022-08-15-20-49.json
Outdated
Show resolved
Hide resolved
packages/modules/viewer-react/src/components/app-ui/EcsqlWidget.tsx
Outdated
Show resolved
Hide resolved
You probably want to be using a Virtualized Table |
packages/modules/viewer-react/src/components/app-ui/EcsqlWidget.tsx
Outdated
Show resolved
Hide resolved
packages/modules/viewer-react/src/components/app-ui/EcsqlWidget.tsx
Outdated
Show resolved
Hide resolved
packages/modules/viewer-react/src/components/app-ui/EcsqlWidget.tsx
Outdated
Show resolved
Hide resolved
| .forEach((key) => { | ||
| row[key] = JSON.stringify(obj[key]); | ||
| }); | ||
| // Case 3: If the cell content is too long, put it inside an ExpandableBlock |
There was a problem hiding this comment.
what does this actually look like?
There was a problem hiding this comment.
what is the type for row here when this occurs? i dont think it matches what you had originally typed it as
There was a problem hiding this comment.
still feels a little weird for me, have you looked at what the standard pattern we use is?
do we just show as much text as we can before showing an ellipses for overflow, and then on hover show the full text in a tool tip or something?
There was a problem hiding this comment.
There was a problem hiding this comment.
Or maybe I just have to customize it a bit more.
packages/modules/viewer-react/src/components/app-ui/EcsqlWidget.tsx
Outdated
Show resolved
Hide resolved
| public readonly id = "EcsqlWidgetProvider"; | ||
|
|
||
| public provideWidgets( | ||
| stageId: string, |
There was a problem hiding this comment.
Take a look at what we do for stageId and stageUsage in the other providers in viewer-components-react
Unfortunately, the virtualized table loses the horizontal scrollbar if there are too many columns, and it can't be added back without some (hacky?) css The performance gain is very important though... |
aruniverse
left a comment
There was a problem hiding this comment.
Good work! We'll take it over once you go back to school. Unless you want to continue contributing as an OpenSource Collaborator ;)
|
|
||
| rows.push(row); | ||
| for (const key of Object.keys(row)) { | ||
| if (!columnHeaders.includes(key)) { |
There was a problem hiding this comment.
well wouldnt they always all not be in columnheaders to begin with?
re-read this block of code here
There was a problem hiding this comment.
Hmm, I'm pretty sure this is right. I wanted columnHeaders to be the superset of all keys in each row, because sometimes each row might have different keys. So every time columnHeaders encounters a new unique key, it should append the new key. columnHeaders is instantiated before we start iterating through each row.



On startup:

Bad query:

Successful query:
