Q: DataTable expand row in a expanded DataTable?

UI Components for React
Post Reply
Mic
Posts: 18
Joined: 27 Sep 2010, 15:59

16 Oct 2020, 08:54

Hi...

I want to use two level of exansion in a DataTable but I wasn't able to do it. If I click on the expander of the "DetailRow1Col0", all expanded rows will be collapsed. How can I handle it or is it not possible?

Example:

> Row1Col0 Row1Col1 ...
v Row2Col0 Row1Col1 ...
--> DetailRow1Col0 DetailRow1Col1 ...
--v DetailRow1Col0 DetailRow1Col1 ...
------ SubDetaillRow1Col0 DetailRow1Col1 ...
------ SubDetaillRow1Col0 DetailRow1Col1 ...
------ SubDetaillRow1Col0 DetailRow1Col1 ...
--> DetailRow1Col0 DetailRow1Col1 ...
> Row3Col0 Row1Col1 ...

Regards,
Michael

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

23 Oct 2020, 15:54

Hi,

Please see our sample;
https://primefaces.org/primereact/showc ... /rowexpand

You can add/remove an item or items using 'expandedRows' state in our demo. It has a fully controlled mechanism.

Best Regards,

Mic
Posts: 18
Joined: 27 Sep 2010, 15:59

04 Nov 2020, 13:03

mert.sincan wrote:
23 Oct 2020, 15:54
Hi,

Please see our sample;
https://primefaces.org/primereact/showc ... /rowexpand

You can add/remove an item or items using 'expandedRows' state in our demo. It has a fully controlled mechanism.

Best Regards,
Hi...

expanding with one level is possible BUT not another expanding in the expanded table! Please see my example in my first post. If I try to expand a row in the expanded table, all expansions will be closed.

Depending on you example: I expanded the row "Bamboo watch" and want to expand the first row "1000 David James" to show other details.

Best regards,
Michael

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

05 Nov 2020, 04:03

Hi,

Thanks a lot for the info! I'll check and get back to you.

Best Regards,

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

05 Nov 2020, 04:15

Hi,

I think the following sample can help to you;
https://codesandbox.io/s/bold-cdn-3z7vd

Best Regards,

Mic
Posts: 18
Joined: 27 Sep 2010, 15:59

10 Nov 2020, 16:16

mert.sincan wrote:
05 Nov 2020, 04:15
Hi,

I think the following sample can help to you;
https://codesandbox.io/s/bold-cdn-3z7vd

Best Regards,
Hi,

many thanks for this example - very helpful!

Best regards,
Michael

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

14 Nov 2020, 00:17

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests