我想扩大Kendo UI网格中的弹出窗口。这样,其中的元素也会填满窗口。
在答案How do I Change window size on kendo grid editor template?中,只有窗口变宽了,但其中的元素也没有变宽。
答案 0 :(得分:1)
简单地在网格定义中提供宽度:https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/editable.window或参见https://stackoverflow.com/a/30778406/4944034以获得实际示例。
答案 1 :(得分:0)
在kendoGrid区域中,将以下代码添加到事件编辑中:
jQuery("#grid").kendoGrid({
...
edit: function(e){
kendoUi_popUpEditWindow_setWidth('950px');
},
...
})
和相应的功能:
function kendoUi_popUpEditWindow_setWidth(width){
if(typeof(width) != "string" || (width + '').indexOf("px") == -1 ){
width = "800px";
}
left = (jQuery( window ).width() - parseInt(width)) / 2;
left = left + "px";
jQuery(".k-widget.k-window").css('left', left);
jQuery(".k-edit-form-container").attr('style', 'width:' + width);
jQuery(".k-edit-form-container .k-edit-field").children().attr('style', 'width:100%');
}