jQuery PivotGridV2 remote flat data wont load

1 Answer 19 Views
PivotGridV2
Moh
Top achievements
Rank 1
Moh asked on 15 Sep 2025, 05:23 AM

Hi,
I’m moving from PivotGrid (v1) to PivotGridV2 on Kendo UI for jQuery 2025.3.825 with an ASP.NET MVC (.NET 8) backend.
In v1 my grid called the controller just fine. In V2, the grid renders, but no data is loaded from the controller and the console keeps showing:
TypeError: Cannot read properties of undefined (reading 'cube')

If I feed local flat data, V2 renders correctly — so my fields, cube, rows/columns/measures seem fine. The problem appears only when I switch to remote flat binding.

What I expect
- PivotGridV2 (client cube / flat binding) to call my MVC action via transport.read and render the returned rows.
- Built-in Excel export to work (it does, when data is present).

What I see
- requestStart fires, then I get a transport error, followed by the “reading 'cube'” error.
- With local data injected, the table renders fine (so the cube + axes look OK).


Code :

const pg = $("#pivotgrid").kendoPivotGridV2({
  height: 570,
  columnTotals: false,
  rowTotals: false,

  dataSource: new kendo.data.PivotDataSourceV2({
    transport: {
      read: {
        url: '@Url.Action("GetPivotData", "ControllerPivot")',
        type: "POST",
        dataType: "json"
        // (also tried contentType: "application/json" + JSON.stringify in parameterMap)
      },
      parameterMap: function () {
        return {
          year: $("#yearDDL").data("kendoDropDownList")?.value(),
          periode: $("#periodDDL").data("kendoDropDownList")?.value()
        };
      }
    },

    schema: {
      // if server returns { data:[...] } I can switch this on:
      // data: "data",
      model: {
        fields: {
          Version:   { type: "string" },
          Period:    { type: "string" },
          Parameter: { type: "string" },
          Value:     { type: "number" }
        }
      },
      cube: {
        dimensions: {
          Version:   { dataMember: "Version" },
          Period:    { dataMember: "Period" },
          Parameter: {
            caption: "Parameter",
            hierarchies: [{
              name: "By Parameter",
              levels: [{ name: "Parameter", field: "Parameter" }]
            }]
          }
        },
        measures: {
          Value: { field: "Value", aggregate: "sum", format: "{0:n2}" }
        }
      }
    },

    columns:  [{ name: "Version",   expand: true }],
    rows:     [{ name: "Parameter", expand: true }],
    measures: ["Value"],

    requestStart: e => console.log("[requestStart]", e),
    requestEnd:   e => console.log("[requestEnd]", e),
    error:        e => console.error("[transport error]", e)
  })
}).data("kendoPivotGridV2");

$("#configurator").kendoPivotConfiguratorV2({
  dataSource: pg.dataSource, updateOnApply: true, filterable: true, height: 570
});
Is there a minimal working example for jQuery PivotGridV2 remote flat binding on 2025.3.825 I can compare with?



Environment

  • Kendo UI for jQuery 2025.3.825

  • PivotGridV2 + PivotConfiguratorV2

  • ASP.NET MVC (.NET 8) backend



1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 17 Sep 2025, 01:28 PM

Hello Moh,

The error TypeError: Cannot read properties of undefined (reading 'cube') indicates that the PivotGridV2 expects the remote data to have a specific structure, but the returned response does not match the expected schema. This usually happens when the schema.data property does not correctly point to the array of data rows, or the controller returns a format that the PivotDataSourceV2 cannot process.

I would suggest review the PivotGridV2 remote data binding documentation and demo:

- https://www.telerik.com/kendo-jquery-ui/documentation/controls/pivotgridv2/binding/remote-flat-binding

https://demos.telerik.com/kendo-ui/pivotgridv2/remote-flat-data-binding 

You can inspect the demo and observe the data returned from the remote end point in the browser Developer Tools Network tab.

Key Points to Check

  • Response Format: The server must return a plain array or an object.
  • Required Fields: Every row must include all fields defined in the cube and model.
  • Error Handling: Use browser dev tools to inspect the network response. If the response does not match the expected format, update your controller or schema accordingly.

    Regards,
    Neli
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

    Moh
    Top achievements
    Rank 1
    commented on 18 Sep 2025, 07:16 AM

    Hi Neli, thank you for your advice,
    but I have another issue: the dataSource transport doesn’t seem to fire. When I open the page, no request hits the controller (nothing in the Network tab). I’m not sure why. Do you have any suggestions for a better way to fetch data from the controller with PivotGridV2?
    For context, the old PivotGrid (v1) worked fine with this approach.
    Neli
    Telerik team
    commented on 23 Sep 2025, 05:53 AM

    Hi Moh,

    From the provided infromation I am not sure what might be the cause of the issue. Could you please provide more details on how the behavior can be replicated locally?

    By default, PivotGridV2 should automatically request data on initialization if the configuration is correct. However, you can force the dataSource to fetch data by calling:

    pg.dataSource.read();

    This can be done after the component and its dependencies are initialized.

    Regards,

    Neli

    Tags
    PivotGridV2
    Asked by
    Moh
    Top achievements
    Rank 1
    Answers by
    Neli
    Telerik team
    Share this question
    or