The Property "expand: false" don't work

2 posts, 0 answers
  1. Gus
    Gus avatar
    29 posts
    Member since:
    Jan 2015

    Posted 23 Feb 2015 Link to this post

    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.






  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 25 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top