Data Table: Expandable Row Groups

UI Components for Vue
Post Reply
ihosteju
Posts: 9
Joined: 06 Sep 2021, 12:18

19 Nov 2021, 10:29

Hello,

Here are a few questions about Row Groups in a datatable
  • Is there a function to expand / collapse all subheader groups?
  • On top of the button class="p-row-toggler" could the subheader value also be clickable ?
  • Could I set some Rowgroups to be expanded by default?
Thanks in advance.

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

24 Nov 2021, 14:19

Hello,
  • According to above question there is no top 'p-row-toggler'
  • And yes, you could set default expanded rows with using 'expandedRows' property
Regards,

ihosteju
Posts: 9
Joined: 06 Sep 2021, 12:18

24 Nov 2021, 17:09

Thanks for your reply but I think there is a mis understanding here.
The questions above are about the Expandable Row Groups with subheaders, like documented here :
https://www.primefaces.org/primevue/sho ... e/rowgroup

any method to handle this? Thanks

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

30 Nov 2021, 15:51

Hi,

Yes, it is possible. For example https://codesandbox.io/s/rowgroup-expand-h6egy

ihosteju
Posts: 9
Joined: 06 Sep 2021, 12:18

02 Dec 2021, 01:45

Thanks! Glad to see that :-)
However there seems to be an issue when I expand all after the collapse all button as been clicked.
Cannot read properties of null (reading 'push')
eval
/src/DataTableRowGroupDemo.vue:128:31

126 | expandAll() {
127 | this.customers.forEach((p) => {
128 | this.expandedRowGroups.push(p.representative.name);
Any idea?

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

03 Dec 2021, 10:23

Yes, It was my mistake. Could you check again collapseAll function? It should be

Code: Select all

this.expandedRowGroups = [];
not

Code: Select all

this.expandedRowGroups = null;

ihosteju
Posts: 9
Joined: 06 Sep 2021, 12:18

03 Dec 2021, 18:09

Perfect Thank you ;)

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests