Skip to content

Commit 0aad182

Browse files
committed
Add how-to demos for the pivotgrid widget
1 parent 541ec17 commit 0aad182

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Filter a dimension
3+
page_title: Filter a dimension
4+
description: Filter a dimension
5+
---
6+
7+
# Filter a dimension
8+
9+
The example below demonstrates how use the data source [filter](docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-filter) option to filter the result set
10+
11+
#### Example:
12+
13+
```html
14+
<div id="example">
15+
<div id="pivotgrid"></div>
16+
17+
<script>
18+
$(document).ready(function () {
19+
var pivotgrid = $("#pivotgrid").kendoPivotGrid({
20+
filterable: true,
21+
columnWidth: 200,
22+
height: 580,
23+
dataSource: {
24+
type: "xmla",
25+
columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
26+
rows: [{ name: "[Geography].[City]" }],
27+
measures: ["[Measures].[Internet Sales Amount]"],
28+
transport: {
29+
connection: {
30+
catalog: "Adventure Works DW 2008R2",
31+
cube: "Adventure Works"
32+
},
33+
read: "http://demos.telerik.com/olap/msmdpump.dll"
34+
},
35+
schema: {
36+
type: "xmla"
37+
},
38+
error: function (e) {
39+
alert("error: " + kendo.stringify(e.errors[0]));
40+
},
41+
filter: {
42+
field: "[Date].[Calendar]",
43+
operator: "endswith",
44+
value: "2005"
45+
}
46+
}
47+
}).data("kendoPivotGrid");
48+
});
49+
</script>
50+
</div>
51+
```
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Modify the measure tag caption
3+
page_title: Modify the measure tag caption
4+
description: Modify the measure tag caption
5+
---
6+
7+
# Modify the measure tag caption
8+
9+
The example below demonstrates how to the measure tags in the header and modify their captions
10+
11+
#### Example:
12+
13+
```html
14+
<div id="example">
15+
<div id="pivotgrid"></div>
16+
17+
<script>
18+
$(document).ready(function () {
19+
var pivotgrid = $("#pivotgrid").kendoPivotGrid({
20+
filterable: true,
21+
columnWidth: 200,
22+
height: 580,
23+
dataSource: {
24+
type: "xmla",
25+
columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
26+
rows: [{ name: "[Geography].[City]" }],
27+
measures: ["[Measures].[Internet Sales Amount]"],
28+
transport: {
29+
connection: {
30+
catalog: "Adventure Works DW 2008R2",
31+
cube: "Adventure Works"
32+
},
33+
read: "http://demos.telerik.com/olap/msmdpump.dll",
34+
parameterMap: function(options, type) {
35+
var query = kendo.data.transports.xmla.fn.options.parameterMap(options, type);
36+
37+
//modify the query here if needed
38+
39+
return query;
40+
}
41+
},
42+
schema: {
43+
type: "xmla"
44+
},
45+
error: function (e) {
46+
alert("error: " + kendo.stringify(e.errors[0]));
47+
}
48+
},
49+
dataBound: function() {
50+
var tags = this.wrapper.find(".k-settings-measures > span.k-button");
51+
52+
tags.each(function() {
53+
var tag = $(this);
54+
var name = tag.text().split(".");
55+
var caption = name[name.length - 1];
56+
57+
caption = caption.substring(1, caption.length - 1);
58+
59+
//update text node
60+
tag[0].childNodes[0].nodeValue = caption;
61+
});
62+
}
63+
}).data("kendoPivotGrid");
64+
});
65+
</script>
66+
</div>
67+
```

0 commit comments

Comments
 (0)