【问题标题】:Hide the line "Drag a column header and drop it here to group by that column"隐藏“将列标题拖放到此处以按该列分组”行
【发布时间】:2015-07-31 10:02:55
【问题描述】:

我有一个简单的 Kendo UI 网格,我不需要列上的拖放功能。因此,我想隐藏以下行:

将列标题拖放到此处以按该列分组

有人可以指导如何隐藏吗?

【问题讨论】:

    标签: kendo-ui telerik kendo-grid


    【解决方案1】:

    请在您的剑道网格中设置属性“groupable: false”。演示请查看以下代码 sn-p。

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>Untitled</title>
    
        <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.common.min.css">
        <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.rtl.min.css">
        <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.default.min.css">
        <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.dataviz.min.css">
        <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.dataviz.default.min.css">
        <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.2.624/styles/kendo.mobile.all.min.css">
    
        <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script src="http://cdn.kendostatic.com/2015.2.624/js/angular.min.js"></script>
        <script src="http://cdn.kendostatic.com/2015.2.624/js/jszip.min.js"></script>
        <script src="http://cdn.kendostatic.com/2015.2.624/js/kendo.all.min.js"></script>
    </head>
    <body>
        <div id="grid"></div>
    
        <script>
            $(document).ready(function () {
                $("#grid").kendoGrid({
                    dataSource: {
                        type: "odata",
                        transport: {
                            read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
                        },
                        pageSize: 20
                    },
                    height: 550,
                    groupable: false, // Please set here true/false and check it
                    sortable: true,
                    pageable: {
                        refresh: true,
                        pageSizes: true,
                        buttonCount: 5
                    },
                    columns: [{
                        template: "<div class='customer-photo'" +
                                        "style='background-image: url(../content/web/Customers/#:data.CustomerID#.jpg);'></div>" +
                                    "<div class='customer-name'>#: ContactName #</div>",
                        field: "ContactName",
                        title: "Contact Name",
                        width: 240
                    }, {
                        field: "ContactTitle",
                        title: "Contact Title"
                    }, {
                        field: "CompanyName",
                        title: "Company Name"
                    }, {
                        field: "Country",
                        width: 150
                    }]
                });
            });
        </script>
    </body>
    </html>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-14
      • 1970-01-01
      • 2014-08-24
      相关资源
      最近更新 更多