Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kendo ui 剑道网格锁定列和分组_Kendo Ui_Kendo Grid - Fatal编程技术网

Kendo ui 剑道网格锁定列和分组

Kendo ui 剑道网格锁定列和分组,kendo-ui,kendo-grid,Kendo Ui,Kendo Grid,我有一个带有锁定(冻结)列和分组的网格,如下所示: demos.telerik.com/kendo-ui/grid/freezed-columns 但我只有一个冻结列和小宽度 当我用长字符串值(例如ShipAddress)按列分组时,组标题中的这些组值显示在多行中 即使网格的第一部分(带锁定列)宽度很小,如何在一行中显示组标题? 解决方案 telerik的Alexander Popov写道: $(document).ready(function() { $("#grid").

我有一个带有锁定(冻结)列和分组的网格,如下所示:

demos.telerik.com/kendo-ui/grid/freezed-columns

但我只有一个冻结列和小宽度

当我用长字符串值(例如ShipAddress)按列分组时,组标题中的这些组值显示在多行中

即使网格的第一部分(带锁定列)宽度很小,如何在一行中显示组标题?


解决方案

telerik的Alexander Popov写道:

$(document).ready(function() {
        $("#grid").kendoGrid({
          dataBound: function(e){
            var grid = this;
            this.lockedTable.find(".k-grouping-row").each(function(index) {
              var arrow = $(this).find("a");
              grid.tbody.find(".k-grouping-row:eq("+index+") td").text($(this).text())
              $(this).find("p").text(" ").append(arrow);
            })
          },
            dataSource: {
                type: "odata",
                transport: {
                    read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
                },
                schema: {
                    model: {
                        fields: {
                            OrderID: { type: "number" },
                            ShipCountry: { type: "string" },
                            ShipName: { type: "string" },
                            ShipCity: { type: "string" },
                            ShipAddress: { type: "string" }
                        }
                    }
                },
                pageSize: 30
            },
            height: 540,
            sortable: true,
            reorderable: true,
            groupable: true,
            resizable: true,
            filterable: true,
            columnMenu: true,
            pageable: true,
            columns: [ {
                    field: "OrderID",
                    title: "Order ID",
                    locked: true,
                    lockable: false,
                    width: 50
                }, {
                    field: "ShipCountry",
                    title: "Ship Country",
                    width: 300
                }, {
                    field: "ShipCity",
                    title: "Ship City",
                    width: 300
                },{
                    field: "ShipName",
                    title: "Ship Name",
                    width: 300
                },  {
                    field: "ShipAddress",
                    lockable: false,
                    width: 400
                }
            ]
        });
    });
$(document).ready(function() {
        $("#grid").kendoGrid({
          dataBound: function(e){
            var grid = this;
            this.lockedTable.find(".k-grouping-row").each(function(index) {
              var arrow = $(this).find("a");
              grid.tbody.find(".k-grouping-row:eq("+index+") td").text($(this).text())
              $(this).find("p").text(" ").append(arrow);
            })
          },
            dataSource: {
                type: "odata",
                transport: {
                    read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
                },
                schema: {
                    model: {
                        fields: {
                            OrderID: { type: "number" },
                            ShipCountry: { type: "string" },
                            ShipName: { type: "string" },
                            ShipCity: { type: "string" },
                            ShipAddress: { type: "string" }
                        }
                    }
                },
                pageSize: 30
            },
            height: 540,
            sortable: true,
            reorderable: true,
            groupable: true,
            resizable: true,
            filterable: true,
            columnMenu: true,
            pageable: true,
            columns: [ {
                    field: "OrderID",
                    title: "Order ID",
                    locked: true,
                    lockable: false,
                    width: 50
                }, {
                    field: "ShipCountry",
                    title: "Ship Country",
                    width: 300
                }, {
                    field: "ShipCity",
                    title: "Ship City",
                    width: 300
                },{
                    field: "ShipName",
                    title: "Ship Name",
                    width: 300
                },  {
                    field: "ShipAddress",
                    lockable: false,
                    width: 400
                }
            ]
        });
    });