【发布时间】:2014-10-29 20:35:31
【问题描述】:
如何控制剑道网格中出现的行数?房地产是有限的,所以我需要在一个非常紧凑的空间里有很多信息。我正在尝试将网格中的所有内容打包在 300 像素高的区域中。
我遇到的问题是,从我的控制器中的 MVC JsonResult 返回的所有 200 多行数据都同时显示在一个页面上。不完全是我想要的。
代码如下,如果对剑道网格格式有更多了解的人可以提供帮助,我将不胜感激。
谢谢!
-RC
{}
var RemoteJsonData_Call = new kendo.data.DataSource({
transport:
{
read: {
type: "GET",
dataType: "json",
url: resourceURL_Call
},
pageSizes: 8,
serverPaging: true
},
schema: {
model: {
ScheduleData: {
extensionDataField: {
fields: {
ScheduleDate: { type: "date" },
ScheduleAmount: { type: "number" },
SchedulePrice: { type: "number" },
ScheduleNotes: { type: "string" }
}
}
}
}
}
})
$('#callSched').kendoGrid({
height: '300',
sortable: true,
reorderable: true,
resizable: true,
pageable: {
numeric: true,
refresh: true,
pageSizes: true,
previousNext: true,
input: true,
info: true
},
columns: [
{
field: "ScheduleDate",
title: "Date",
template: "#= kendo.toString(kendo.parseDate(ScheduleDate, 'MM-dd-yyyy'), 'MM-dd-yyyy') #"
},
{
field: "ScheduleAmount",
title: "Amount",
},
{
field: "SchedulePrice",
title: "Price"
},
{
field: "ScheduleNotes",
title: "Notes"
}
], dataSource: RemoteJsonData_Call
});
{}
【问题讨论】:
-
其他人可能知道如何通过剑道做到这一点。我们只是查看了渲染输出并找到了主标签并手动使用 css 调整了大小。不漂亮,但效果很好
-
问题不在于 size。 I 初始响应显示响应中的每一行。当我单击 chrome 中的分页控件时,一切都按预期运行并在分配的容器内稳定下来 - 但是当控件首次呈现时,有数据行溢出容器外部,在其他控件后面,到数据的末尾.它很奇怪。
标签: asp.net-mvc-4 kendo-ui kendo-grid