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.

Is it possible to toggle expand rows?

See original GitHub issue

I was wondering if it’s possible to expand/unexpand the rows in the datable.

I’m submitting a … (check one with “x”)

[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
ticklemycodecommented, May 4, 2018

Is it possible to declare a set of rows to expanded by default?

3reactions
roberthelmick08commented, May 23, 2018

@ticklemycode you could achieve this by doing something similar to below. It filters rows by rowIndex (or any other property) then iterates through the filtered rows and changes the expanded property.

rows.filter(temp => temp.rowIndex > 0 && temp.rowIndex < 10).map(row => {
    row.expanded = true;
}

Don’t forget to define expanded and rowIndex in your html template:

<ngx-datatable-column name="" [width]="22" [minWidth]="22" [maxWidth]="22" [frozenLeft]="true">
    <ng-template let-row="row" let-expanded="expanded" let-rowIndex="rowIndex" ngx-datatable-cell-template></ng-template>
        // ...
</ngx-datatable-column>

This is just off the top of my head, so it may require some tweaking, but the idea is that you would iterate through the array of rows and set the expanded properties to true;

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery - Expand table rows - toggle - Stack Overflow
I have a table that is using expand rows feature. I am trying to add an Expand All to expand all, using 'toggleClass'....
Read more >
How to Use the Excel Collapse Rows Feature? — 4 Easy Steps
Now, toggle between the + and – signs to collapse and expand the rows.
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 >
Bootstrap Table collapse/expand rows - free examples & tutorial.
Responsive Table collapse/expand rows built with Bootstrap 5. Use an accordion to collapse a table row vertically to show or hide content.
Read more >
Expand and Collapse Rows - DevExtreme - DevExpress
All rows are collapsed by default. Assign an array of keys to the expandedRowKeys property to expand specific rows initially. If a to-be-expanded...
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