New to Kendo UI for jQuery? Start a free 30-day trial

Schema.cube

configuration

The cube declaration. If configured, this option will enable the client cube processing that is useful for binding to flat data.

Only applicable if client cube processing is used. Necessary when binding the Pivot to data of type "odata".

A set of key/value pairs which specifies the field-dimension mapping that is available for processing dimensions. The key specifies the name of the field to which the dimension will be mapped.

The key has to match the column name that is used in the columns definition.

<script>
  var dataSource = new kendo.data.PivotDataSourceV2({
    columns: ["ProductName" ],
    rows: ["Category"],
    data: [{ ProductName: "Chai", UnitPrice: 42, Cateogry: "Beverages" } ],
    schema: {
      cube: {
        dimensions: {
          ProductName: { caption: "All Products" },
          Category: { caption: "All Cateogries" }
        }
      }
    }
  });

  dataSource.fetch(function() {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(dataSource.data(), dataSource.axes());
  });
</script>

A set of key/value pairs which specifies the available measures. The key specifies the name of measure.

The key has to match the measure name that is used in the measures definition of the PivotDataSourceV2.

<script>
  var dataSource = new kendo.data.PivotDataSourceV2({
    columns: ["ProductName" ],
    rows: ["Category"],
    measures: ["Sum"],
    data: [{ ProductName: "Chai", UnitPrice: 42, Cateogry: "Beverages" } ],
    schema: {
      cube: {
        dimensions: {
          ProductName: { caption: "All Products" },
          Category: { caption: "All Cateogries" }
        },
        measures: {
          "Sum": {
              field: "UnitPrice",
              format: "{0:c}",
              aggregate: "sum"
          }
        }
      }
    }
  });

  dataSource.fetch(function() {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(dataSource.data(), dataSource.axes());
  });
</script>