我整理了一个 KendoUI 网络网格的简单示例:
<div id="peopleGrid"></div>
<link type="text/css" rel="stylesheet" href="/Content/kendoui.web.2012.3.1114.commercial/styles/kendo.common.min.css" />
<link type="text/css" rel="stylesheet" href="/Content/kendoui.web.2012.3.1114.commercial/styles/kendo.default.min.css" />
<script type="text/javascript" src="/Content/kendoui.web.2012.3.1114.commercial/js/kendo.web.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#peopleGrid').kendoGrid({
dataSource: {
type: 'json',
transport: {
read: '/People/JsonTest'
},
schema: {
model: {
fields: {
ID: { type: 'number' },
FirstName: { type: 'string' },
LastName: { type: 'string' }
}
}
},
pageSize: 10,
serverPaging: false,
serverFiltering: false,
serverSorting: false
},
height: 250,
filterable: true,
sortable: true,
pageable: true,
resizable: true,
reorderable: true,
editable: {
mode: 'popup'
},
toolbar: ['create'],
columns: [
{
field: 'ID',
filterable: false,
hidden: true
},
{
field: 'FirstName',
title: 'First Name'
}, {
field: 'LastName',
title: 'Last Name'
},
{
command: ['edit', 'destroy'], title: ' '
}
]
});
});
</script>
网格初始化并且看起来正确。当我单击记录上的编辑按钮或工具栏中的创建按钮时,会显示弹出窗口。但是,它似乎没有动画。它在窗口的中心只有几个像素可见。
检查 DOM 将其显示为弹出窗口包含元素的样式:
transform: scale(0.1);
在 DOM 中编辑它会修复显示。所以看起来应该有一些动画正在发生,但没有。我的代码中是否有问题阻止它,或者可能是我需要包含的其他资源?当弹出窗口处于活动状态时,按下esc
将其关闭会产生一个小动画,将其扩展为正常大小,同时将其淡出。所以动画似乎发生在错误的时间。有任何想法吗?
此外,我看到当弹出窗口关闭时,关联的记录会从网格中删除。我不知道为什么会这样。但任何建议将不胜感激。谢谢!