Search code examples
javascriptasp.net-mvckendo-uitelerikpivot-table

Kendo PivotGrid with 2 or more measures


I need to use the new widget - Kendo PivotGrid with two measures at once, but a javascript error is thrown: "tuple.members[measureIndex] is undefined" (in debug mode i can see that "measureIndex" is undefined). This happens when the PivotGrid is defined with HTML5/javascript and MVC Extensions too, with AJAX binding. I've tried this in Dojo platform too, but still no success. My syntax is something like this:

...
cube: {
 measures: {
   "Contacts Count": { field: "CustomerID", aggregate: function(value, state) { return state + 1; } },
   "Sum": { field: "UnitPrice", format: "{0:c}", aggregate: function(value, state) { return value + state; } }
 }
...
measures: {
  values: ["Contacts Count","Sum"],
  axis: "columns"
}
...

I've tried to set axis to "rows", but then there is no error, but the PivotGrid shows only first measure (in this case "Contacts Count") and in rows there is only one row which title is "undefined". So this is not an option... The PivotGrid works perfectly with only one measure at once, but with two or more it throws the above error. Please tell me if I am doing something wrong or if there is a bug in this case. I saw that this is working in demos, but with xmla binding. Unfortunately I have to use ajax binding.


Solution

  • Multiple measures aren't yet supported when not binding to an OLAP cube. This will be supported when the Kendo UI PivotGrid gets out of beta. Should happen by September 2014.