【问题标题】:mvc kendo grid resize issuemvc剑道网格调整大小问题
【发布时间】:2018-12-10 13:22:57
【问题描述】:

我的项目中有一个剑道网格,

 @(Html.Kendo()
          .Grid(Model)
          .Name("BuilderGrid")
          .Columns(columns =>
          {
           .......................
           .......................
          }).HtmlAttributes(new { style = "width:100%; height:100%;" })

网格数据加载正常。如果我调整浏览器窗口的大小或调整网格的大小,最后 2 或 3 个网格行没有显示,有时最后一行显示 cut .FYI -

【问题讨论】:

  • 你能不能给个屏幕截图来显示整个页面,看看它是如何组合在一起的?
  • 您好,请根据要求查找以下图片。图片 1 - link 图片 2 - link
  • 你可以删除所有的 HTML 属性标签然后尝试它,如果它可以开始慢慢添加它们直到你找到问题标签/属性。
  • 删除了所有的 HTML 属性或样式,但不起作用。我正在使用 MVC 4。Kendo UI 是否支持它?如果我调整浏览器窗口的大小,则会显示相同的问题。
  • 这是我找到的一些关于 MVC 4 和 Kendo 的信息:docs.telerik.com/aspnet-mvc/asp-net-mvc-4

标签: asp.net-mvc kendo-ui kendo-grid telerik-mvc


【解决方案1】:

我找到了。需要在页面上添加这些行。

$(document).ready(function () {
    $(window).resize(function () {
        resizeGrid();
    });
});

function resizeGrid() {
    var gridWidget = $("#BuilderGrid").data("kendoGrid");

    // apply the new height and trigger the layout readjustment
    gridWidget.wrapper.height(847);
    gridWidget.resize();

    // force the layout readjustment without setting a new height
    gridWidget.resize(true);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-16
    • 2020-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    相关资源
    最近更新 更多