Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS API Tree tables cannot expand or collapse when key column is not in viewport #4774

Closed
mattrunyon opened this issue Nov 6, 2023 · 1 comment · Fixed by #4791
Closed
Assignees
Labels
bug Something isn't working core Core development tasks jsapi
Milestone

Comments

@mattrunyon
Copy link
Contributor

Description

In the web UI, if a tree table has enough columns and scrolls horizontally, the key column is not explicitly fetched as part of the viewport. The client should be able to expand/collapse even if they don't explicitly specify the key column in the viewport.

Steps to reproduce

  1. Create a tree/rollup table with many columns
  2. Make the table narrow enough where at least half the columns are overflowing
  3. Scroll horizontally to the right of the table
  4. Right click on a row and expand it

Expected results

Table expands row

Actual results

Table throws

Uncaught Error: java.util.NoSuchElementException: Column id not found in row, was it specified in the viewport?
    at NoSuchElementException_0.createError (dh-core.js:1217:10)
    at NoSuchElementException_0.initializeBackingError (dh-core.js:1237:46)
    at NoSuchElementException_0.Throwable_0 (dh-core.js:1182:8)
    at NoSuchElementException_0.Exception_1 (dh-core.js:1261:18)
    at NoSuchElementException_0.RuntimeException_1 (dh-core.js:1274:18)
    at new NoSuchElementException_0 (dh-core.js:3889:25)
    at Object.$get_9 (dh-core.js:25906:16)
    at JsTreeTable$TreeViewportData$TreeRow.get_15 [as get] (dh-core.js:25941:18)
    at Object.$get_2 (dh-core.js:7885:14)
    at Object.$appendKeyData (dh-core.js:27319:47)
    at Object.$setExpanded (dh-core.js:26671:10)
    at JsTreeTable.setExpanded (dh-core.js:26919:10)
    at tS.setRowExpanded (IrisGridTreeTableModel.js:123:18)
    at oS.setRowExpanded (IrisGridProxyModel.js:95:28)
    at Dt.toggleRowExpanded (Grid.js:404:13)
    at ki.onClick (GridRowTreeMouseHandler.js:50:14)
    at Dt.handleClick (Grid.js:1396:24)
    at Object.oHe (react-dom.production.min.js:52:317)
    at sHe (react-dom.production.min.js:52:471)
    at uHe (react-dom.production.min.js:53:35)
    at _oe (react-dom.production.min.js:100:68)
    at pbe (react-dom.production.min.js:101:380)
    at react-dom.production.min.js:113:65
    at H0e (react-dom.production.min.js:292:189)
    at aHe (react-dom.production.min.js:50:57)
    at vbe (react-dom.production.min.js:105:469)
    at Mee (react-dom.production.min.js:75:265)
    at Oee (react-dom.production.min.js:74:124)
    at e.unstable_runWithPriority (scheduler.production.min.js:18:343)
    at eg (react-dom.production.min.js:122:325)
    at V0e (react-dom.production.min.js:292:48)
@mattrunyon mattrunyon added bug Something isn't working jsapi labels Nov 6, 2023
@niloc132 niloc132 added this to the November 2023 milestone Nov 6, 2023
@rcaudy rcaudy added the core Core development tasks label Nov 6, 2023
@nbauernfeind
Copy link
Member

Here is a reproducer at the front of the table:

dummies = []
for (ii = 0; ii < 40; ++ii) {
    dummies.add(Selectable.parse("A" + ii + " = 0"))
}
def source = timeTable("PT0.1s")
    .updateView(dummies as List)
    .update("id = ii", "parent_id = ii == 0 ? null : ii % 5 == 0 ? ii - 1 : ii % 3 == 1 ? ii - 1 : null")
result = source.tree("id", "parent_id")

You can swap the update and updateView to reproduce via scrolling to the right and then right clicking as described above.

niloc132 added a commit to niloc132/deephaven-core that referenced this issue Nov 7, 2023
If the user doesn't subscribe to a key column, the TreeTable should
still subscribe to it and track its values, but not confuse user code by
populating them into TableData instances.

Fixes deephaven#4774
niloc132 added a commit that referenced this issue Nov 13, 2023
If the user doesn't subscribe to a key column, the TreeTable should
still subscribe to it and track its values, but not confuse user code by
populating them into TableData instances.

Fixes #4774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Core development tasks jsapi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants