dataSource Object|kendo.data.PivotDataSource

The data source of the widget which is used to display values. Can be a JavaScript object which represents a valid data source configuration or an existing kendo.data.PivotDataSource instance.

If the dataSource option is set to a JavaScript object the widget will initialize a new kendo.data.PivotDataSource instance using that value as data source configuration.

If the dataSource option is an existing kendo.data.PivotDataSource instance the widget will use that instance and will not initialize a new one.

Example - set dataSource as a JavaScript object

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Example - set dataSource as an existing kendo.data.PivotDataSource instance

<div id="pivotgrid"></div>
<script>
var dataSource = new kendo.data.PivotDataSource({
    type: "xmla",
    columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
    rows: [{ name: "[Product].[Product]" }],
    measures: ["[Measures].[Internet Sales Amount]"],
    transport: {
        connection: {
            catalog: "Adventure Works DW 2008R2",
            cube: "Adventure Works"
        },
        read: {
            url: "https://demos.telerik.com/olap/msmdpump.dll",
            dataType: "text",
            contentType: "text/xml",
            type: "POST"
        }
    },
    schema: {
        type: "xmla"
    }
});

$("#pivotgrid").kendoPivotGrid({
    height: 550,
    dataSource: dataSource
});
</script>
In this article