Sort Dimensions
The following example demonstrates how use data source sort
option to sort the result set.
Example
<div id="example">
<div id="pivotgrid"></div>
<script>
$(document).ready(function () {
var pivotgrid = $("#pivotgrid").kendoPivotGrid({
filterable: true,
columnWidth: 200,
height: 580,
dataSource: {
type: "xmla",
columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
rows: [{ name: "[Geography].[City]" }],
measures: ["[Measures].[Internet Sales Amount]"],
transport: {
connection: {
catalog: "Adventure Works DW 2008R2",
cube: "Adventure Works"
},
read: "https://demos.telerik.com/olap/msmdpump.dll"
},
schema: {
type: "xmla"
},
error: function (e) {
alert("error: " + kendo.stringify(e.errors[0]));
},
sort: [{
field: "[Date].[Calendar]",
dir: "asc" //or desc
}]
}
}).data("kendoPivotGrid");
});
</script>
</div>
See Also
- PivotGrid JavaScript API Reference
- How to Change Data Source Dynamically
- How to Drill Down Navigation Always Starting from Root Tuple
- How to Expand Multiple Column Dimensions
- How to Filter by Using the include Operator
- How to Integrate with Kendo UI Chart
- How to Make the Include fields Window Modal
- How to Modify Measure Tag Captions
- How to Reload PivotGrid Configuration Options
- How to Reset Expand State
- How to Show Tooltip with Data Cell Information
- How to Translate PivotConfigurator Field Items
For more runnable examples on the Kendo UI PivotGrid, browse its How To documentation folder.