How to expand defaultRowAxes in pivot table by default.

1 Answer 79 Views
Grid
Jaskaran
Top achievements
Rank 1
Jaskaran asked on 02 Nov 2023, 01:11 PM

Hello Team,

I hope your week is going smoothly. I’m reaching out to you because, I am facing a problem to expand Rows in kendo pivot table. I am using kendo react pivot grid version: 

"@progress/kendo-react-pivotgrid": "^5.9.0",

I want to expand all rows (defalutRowAxes) by default when pivot table is loded. I used concat method to expand rows by default, its working fine for first and second level. For Region and Country fields its working. But, for third level (Category field) its not expanding row by default. I need to expand third field Category by deault as well.

Here is the link of my code: https://codesandbox.io/s/determined-carson-7l99lg

Thanks in Advance

Jaskaran
Top achievements
Rank 1
commented on 09 Sep 2024, 07:08 AM

I want to expand my row_header_text by default. However, I’m unable to achieve this. Could you suggest a solution that ensures the row headers will expand by default, regardless of the number of columns?
Konstantin Dikov
Telerik team
commented on 10 Sep 2024, 01:10 PM

Hi Jaskaran,

As with the previous post, the same approach must be used for expanding nested levels:

const defaultRowAxes = [
  {
    name: ["Region"],
    expand: true
  },
  {
    name: ["Country"]
  },
  {
    name: ["Category"]
  },
  {
    name: ["Region&Asia", "Country"],
    expand: true
  },
  {
    name: ["Region&Asia", "Country&China", "Category"],
    expand: true
  }
];

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 06 Nov 2023, 11:58 AM

Hi Jaskaran,

Each level require the complete name to be set and in the example in question, you need to include the Region as well when you want to expand the Categories. Here is the expected format:

name: ["Region&Asia","Country&China", "Category"],

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Jaskaran
Top achievements
Rank 1
commented on 14 Nov 2023, 11:56 AM | edited

Hello Team,
I tried to include the Region as well and  converted it into give format (name : [ "Region&Asia", "Country&China",  "Category") , but it thorws an error : 
cannot read proprties of null ( reading "rowTuple" ) .
I have attached screenshot and here is the link for code :
https://codesandbox.io/s/pensive-volhard-8zvw9h 
hope it will help you in debuging the issue. 

Konstantin Dikov
Telerik team
commented on 16 Nov 2023, 08:50 AM

Hi Jaskaran,

You will first have to add expand for the "Country" and then add the expand for the Category:

const defaultRowAxes = [
  {
    name: ["Region"],
    expand: true
  },
  {
    name: ["Country"]
  },
  {
    name: ["Category"]
  },
  {
    name: ["Region&Asia", "Country"],
    expand: true
  },
  {
    name: ["Region&Asia", "Country&China", "Category"],
    expand: true
  }
];

Tags
Grid
Asked by
Jaskaran
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or