dataCellTemplate String|Function

The template which renders the content of the data cell. By default renders the formatted value (fmtValue) of the data item.

The fields which can be used in the template are:

  • columnTuple - the tuple of the corresponding column header cell
  • rowTuple - the tuple of the corresponding row header cell
  • measure - the value of the data cell measure
  • dataItem - the data item itself

For information about the tuple structure check this link. About the data item structure review this help topic.

Example - emphasize the values in 2005

<div id="pivotgrid"></div>

<script id="dataCellTemplate" type="text/x-kendo-template">
    # if (columnTuple.members[0].name === "[Date].[Calendar].[Year].&[2005]") { #
        <em>#: kendo.toString(kendo.parseFloat(dataItem.value), "c2") #</em>
    # } else { #
        #: kendo.toString(kendo.parseFloat(dataItem.value), "c2") #
    # } #
</script>

<script>
$("#pivotgrid").kendoPivotGrid({
    dataCellTemplate: $("#dataCellTemplate").html(),
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true } ],
        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>
In this article
Not finding the help you need? Improve this article