dataSource Object|kendo.data.PivotDataSourceV2
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.PivotDataSourceV2 instance.
If the dataSource
option is set to a JavaScript object the widget will initialize a new kendo.data.PivotDataSourceV2 instance using that value as data source configuration.
If the dataSource
option is an existing kendo.data.PivotDataSourceV2 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").kendoPivotGridV2({
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: 'https://demos.telerik.com/olap/msmdpump.dll'
}
}
});
</script>
Example - set dataSource as an existing kendo.data.PivotDataSourceV2 instance
<div id="pivotgrid"></div>
<script>
var dataSource = new kendo.data.PivotDataSourceV2({
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: 'https://demos.telerik.com/olap/msmdpump.dll'
}
});
$("#pivotgrid").kendoPivotGridV2({
height: 550,
dataSource: dataSource
});
</script>