question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expanded rows should be controllable

See original GitHub issue

As requested here.

Gist:

The rowExpansion property object should also include:

  • records → currently expanded records
  • onChange → callback fired when currently expanded records change: onChange: (records: T[]) => void

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
icflorescucommented, Oct 14, 2022

Done in v1.7.9. Can be used like this:

<DataTable
  // ...
  rowExpansion={{
    // ...
    expanded: {
      recordIds: expandedRecordIds,
      onRecordIdsChange: setExpandedRecordIds,
    },
  }}
/>

Full working example in Controlled mode section of this page.

1reaction
icflorescucommented, Oct 12, 2022

@otobot1 Not yet, but I will over the weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature Request] Allow for controlled expandedRows #724
Currently, expandedRows is uncontrolled, allowing rows only to be expanded using the built-in dropdown. This functionality is perfect is ...
Read more >
Collapse and Expand Rows | WinForms Controls
The control raises the RowCollapsing, RowCollapsed, RowExpanding, and RowExpanded events before and after the corresponding operation. Use the ...
Read more >
How can I collapse an already expanded expandable row in ...
Basically this allows you to expand a row and have any other rows that are expanded, to collapse. I want to be able...
Read more >
Expanding | TanStack Table Docs
Returns a function that can be used to toggle the expanded state of the row. This function can be used to bind to...
Read more >
Examples › Expanding rows | Mantine DataTable
Controlled mode​​ You can control the row expansion feature by pointing the rowExpansion / expanded property to an object containing: recordIds → an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found