mvc kendo 网格调整大小问题
mvc kendo grid resize issue
我的项目中有一个 kendo 网格,
@(Html.Kendo()
.Grid(Model)
.Name("BuilderGrid")
.Columns(columns =>
{
.......................
.......................
}).HtmlAttributes(new { style = "width:100%; height:100%;" })
网格数据加载正常。如果我调整浏览器大小 window 或调整网格大小,最后 2 或 3 个网格行不显示,有时最后一行显示剪切。仅供参考 -
我找到了。需要在页面上添加这些行。
$(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);
}
我的项目中有一个 kendo 网格,
@(Html.Kendo()
.Grid(Model)
.Name("BuilderGrid")
.Columns(columns =>
{
.......................
.......................
}).HtmlAttributes(new { style = "width:100%; height:100%;" })
网格数据加载正常。如果我调整浏览器大小 window 或调整网格大小,最后 2 或 3 个网格行不显示,有时最后一行显示剪切。仅供参考 -
我找到了。需要在页面上添加这些行。
$(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);
}