setDataSource
Sets the data source of the widget.
Parameters
dataSource kendo.data.PivotDataSource
The data source to which the widget should be bound.
Example - set the data source
<div id="configurator"></div>
<script>
$("#configurator").kendoPivotConfigurator({
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"
},
discover: {
url: "https://demos.telerik.com/olap/msmdpump.dll",
dataType: "text",
contentType: "text/xml",
type: "POST"
}
},
schema: {
type: "xmla"
}
}
});
var dataSource = new kendo.data.PivotDataSource({
type: "xmla",
columns: [{ name: "[Date].[Calendar]", expand: true }],
rows: [{ name: "[Product].[Product]" }],
measures: ["[Measures].[Internet Sales Amount]"],
transport: {
connection: {
catalog: "Adventure Works DW 2008R2",
cube: "Adventure Works"
},
discover: {
url: "https://demos.telerik.com/olap/msmdpump.dll",
dataType: "text",
contentType: "text/xml",
type: "POST"
}
},
schema: {
type: "xmla"
}
});
setTimeout(function(){
var configurator = $("#configurator").data("kendoPivotConfigurator");
configurator.setDataSource(dataSource);
}, 2000);
</script>