material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Ability to toggle detail panels from location other than front of row.

Open roseak opened this issue 7 years ago • 9 comments

Just like there's now a way to display action icons based on column index, it would be great to be able to toggle the detail panel row from other locations than the beginning of the row. I'd like to be able to click on or next to a specific column that has info or buttons related to it and then be able to see that content in the detail panel by clicking there. Basically allowing the placement of icons that will trigger the detail panel to be done based on column index.

roseak avatar Jan 25 '19 21:01 roseak

Hi @roseak,

That would be really great feature. Such as rowclick of any other event should fire the detailPanel toggle. Now i am working data grouping feature. Then i will consider this feature.

mbrn avatar Jan 25 '19 21:01 mbrn

Hi @mbrn , I like the idea of row clicking to fire the detailPanel toggle.

Looking forward to it!

'data grouping feature'? Do you mean tree data structure?

Anyway, this is a nice, handy library!

Thank you!

hcsgzh avatar Feb 01 '19 04:02 hcsgzh

I will do this for next release. Data grouping is now done. You can use it. Look at examples. Tree data feature is another feature that i will do in 2 3 weeks

mbrn avatar Feb 01 '19 04:02 mbrn

This is done now. Usage is simple. I set toggleDetail function as third parameter onRowClick. You can use it like this:

onRowClick={(event, rowData, togglePanel) => togglePanel()}
// if you have multiple panel you can send panel index as parameter
onRowClick={(event, rowData, togglePanel) => togglePanel(1)}

mbrn avatar Feb 01 '19 06:02 mbrn

v1.16.0 published

mbrn avatar Feb 01 '19 06:02 mbrn

Hi mbrn, I'm loving the library! Is there any way that I could trigger the detail panel based on a specific cell click? For example, triggering a different detail panel depending on which cell in the row I click?

Thanks in advance!

raph90 avatar Jul 11 '19 10:07 raph90

Do we have any possibility to togglePanel from a single cell (Column)?

OscarGalindo avatar Aug 01 '19 10:08 OscarGalindo

It would just be nice of the onRowClick was also provided the column definition as an argument. That way, it would be possible to set some state to determine what should be displayed in the detail panel.

gary-menzel avatar Oct 18 '19 01:10 gary-menzel

https://github.com/mbrn/material-table/issues/1340#issuecomment-573429029

rocketkittens avatar Jan 20 '20 23:01 rocketkittens