This is a migrated thread and some comments may be shown as answers.

The Property "expand: false" don't work

1 Answer 137 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Gus
Top achievements
Rank 2
Gus asked on 23 Feb 2015, 10:14 PM
Hello,

I am try to block a expand column in pivot grid, in this example I especify the column with name: "Country" with property expand = false, but on the grid to allow expand this column (the property don't work):

<!DOCTYPE html>
<html>
<head>
    <base href="http://demos.telerik.com/kendo-ui/pivotgrid/remote-flat-data-binding">
    <style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1411/styles/kendo.common.min.css" />
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1411/styles/kendo.default.min.css" />
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1411/styles/kendo.dataviz.min.css" />
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1411/styles/kendo.dataviz.default.min.css" />

    <script src="http://cdn.kendostatic.com/2014.3.1411/js/jquery.min.js"></script>
    <script src="http://cdn.kendostatic.com/2014.3.1411/js/kendo.all.min.js"></script>
</head>
<body>
<div id="example">
    <div id="configurator"></div>
    <div id="pivotgrid"></div>

    <script>
        $(document).ready(function () {
            var pivotgrid = $("#pivotgrid").kendoPivotGrid({
                columnWidth: 120,
                height: 570,
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
                    },
                    schema: {
                        cube: {
                            dimensions: {
                                ContactName: { caption: "All Contacts" },
                                CompanyName: { caption: "All Companies" },
                                Country: { caption: "All Countries" },
                                ContactTitle: { caption: "All Titles" }
                            },
                            measures: {
                                "Contacts Count": { field: "CustomerID", aggregate: "count" }
                            }
                        }
                    },
                    columns: [{ name: "Country" , expand: false }, { name: "CompanyName" } ],
                    rows: [{ name: "ContactTitle", expand: true }],
                    measures: ["Contacts Count"]
                }
            }).data("kendoPivotGrid");

            $("#configurator").kendoPivotConfigurator({
                dataSource: pivotgrid.dataSource,
                height: 570
            });
        });
    </script>
    <style>
        #pivotgrid
        {
            display: inline-block;
            vertical-align: top;
            width: 70%;
        }

        #configurator
        {
            display: inline-block;
            vertical-align: top;
        }
    </style>
</div>


</body>
</html>

Source code: http://dojo.telerik.com/ENAyO 

How I can block the expand  option of the colum or row on the pivot grid?

Thanks.






1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 25 Feb 2015, 10:37 AM
Hello Gustavo,

The expand option says whether the root dimension should be expanded on initial load or not.
To prevent dimension expand, you will need to wire the expandMember event and prevent the default action when it is needed. Check the updated Dojo demo.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
PivotGrid
Asked by
Gus
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Share this question
or