如何在Kendo网格编辑器模板上更改窗口大小? [英] How do I Change window size on kendo grid editor template?

查看:122
本文介绍了如何在Kendo网格编辑器模板上更改窗口大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的剑道网格的编辑器模板定义为

I have a editor template for my kendo grid defined as

<script id="my-editor-template" type="text/x-kendo-template"> 
    <div class="k-edit-label">
        <label for="ContactName">Contact</label>
    </div>
    <div data-container-for="ContactName" class="k-edit-field">
        <input type="text" class="k-input k-textbox" name="ContactName" data-bind="value:ContactName">
    </div>
    <!-- more fields, etc -->
</script>

在网格定义中,我这样定义可编辑内容:

In my grid definition, I definte editable like this:

        editable =
        {
            mode: 'popup',
            template: kendo.template($('#my-editor-template').html()),
            confirmation: 'Are you sure you want to delete rec'
        };

但是我想扩大弹出窗口.我尝试将模板的内容包装在

But I would like to make the popup window wider. I tried wrapping the contents of my template in a

<div style="width: 800px;"></div> 

但弹出窗口保持不变,并使内容可滚动(即400px窗口中的800px内容).

but the popup window stayed the same with, and made the contents scrollable (i.e., 800px content inside a 400px window).

我知道我可以做

$(".k-edit-form-container").parent().width(800).data("kendoWindow").center();

在打开窗口后,但是窗口的所有内容都被格式化为400px,感觉有点黑.我无法在模板标记中指定大小吗?

after the window is opened, but all the content of the window is formatted for like 400px, and it feels a little hackish. Is there not a way I can dictate teh size in the template markup?

推荐答案

Kendo网格弹出窗口正在使用剑道窗口,因此您可以像这样设置高度和宽度

Kendo grid popup window is using kendo window, so you can set the height and width like this

editable: {
  mode: "popup",
  window: {
      title: "My Custom Title",
      animation: false,
      width: "600px",
      height: "300px",
  }
}

这里是 dojo ,但是由于我没有定义自定义模板,因此它仍使用默认模板因此,结果窗口尺寸已经是600 x 300,但内容不是.

Here is dojo for you, but since i did not define a custom template it still use default one so as the result the window size already 600 x 300 but the content is not.

这篇关于如何在Kendo网格编辑器模板上更改窗口大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆