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.

Support making expansion depend on which column of a row was clicked

See original GitHub issue

Question Is it possible to make expandRow include the column that was selected?

I have a BootstrapTable where I want to be able to show a different expansion, depending on which column thew user clicked. I can see which column was clicked by looking at the event in the expandRow.onExpand handler, but I haven’t found a good way make the result of the subsequent expandRow.render call depend on it.

I would like a column index as a parameter to the render method, and I would like a way to prevent expansion be returning false from the render method, e.g. not all columns need to cause an expansion of the row.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AllenFangcommented, Sep 18, 2019

hello, @Bopzor

i think your case is because you try to set state for manage the row expand, however, it break the call of cell editing. But I think there’s still a workaround is trigger cell editing via expose api:

https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/exposed-api.html#trigger-cell-editing

Let me know if above solution is not work, I will figure out how to achieve your requirement. Thanks

0reactions
donnrricommented, Nov 19, 2020

I solved this using

              events: {
                onClick:  e => e.stopPropagation()
              }

On each column I wanted to NOT expand the row when clicked on , leaving the one I DID want the click to expand the row without that code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expand, collapse, or show details in a PivotTable ...
In a PivotTable or PivotChart, you can expand or collapse to any level of data detail, and even for all levels of detail...
Read more >
How to prevent row from expanding when a column has ...
In your template, pass the $event to your openAlert() method. (click)="openAlert($event)". Then, in your typescript file update the ...
Read more >
How to group rows in Excel to collapse and expand them
On the Data tab, in the Outline group, click the Group button, select Rows, and click OK. This will add a bar on...
Read more >
ARIA: row role - Accessibility - MDN Web Docs - Mozilla
An element with role="row" is a row of cells within a tabular structure. A row contains one or more cells, grid cells or...
Read more >
Table Options - Bootstrap Table
Detail: Enable expansion per row when detailView is set to true . Return true, and the row will be enabled for expansion, return...
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