如何在剑道上摆脱/覆盖添加行弹出窗口标题?

时间:2019-02-05 17:08:26

标签: javascript jquery kendo-ui kendo-grid

我正在尝试从剑道上的添加行弹出窗口中删除标题。我在其他不是新行弹出窗口的弹出窗口中对其进行管理,似乎无法弄清楚。 enter image description here

这是我用于弹出窗口的代码

<script type="text/x-kendo-template" id="popup-editor-servers">
<p style="padding-left:15px; font-weight:bold; font-size:medium">Add Server</p>
<div class="k-edit-label">
    <label for="txt-host">Name:</label>
</div>

<!-- textbox editor for field: "LastName" -->
<!-- field: "LastName" is not included as a grid column -->
<input type="text" id="txt-host" class="k-input k-textbox" data-bind="value:Host">

我不介意将其完全删除,但是我想只要我可以使用标题就可以做任何事情。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

弄清楚了。下面的代码可以完成这项工作。网格是

<div id="grid-acl"
         data-role="grid"
         data-auto-bind="true"
         data-sortable="{allowUnsort: false}"
         data-filterable="false"
         data-editable='{mode: "popup", template: kendo.template($("#popup-editor").html())}' ,
         data-groupable="false"
         data-columns='[
        { field: "Name", title: "AD User", width: "400px" },
         @*{ field: "Sid", title: "SID" }, *@
        ]'
         data-bind="source: dataSource, events: { change: onChange, dataBound: onDataBound }">
    </div>

弹出式内容在这里:

<script type="text/x-kendo-template" id="popup-editor-servers">
<p style="padding-left:15px; font-weight:bold; font-size:medium">Add Server</p>
<div class="k-edit-label">
<label for="txt-host">Name:</label>
</div>

<input type="text" id="txt-host" class="k-input k-textbox" data-bind="value:Host">

在按钮上单击:

create: function (event) {
            var grid = $("#grid-servers").data("kendoGrid");
            grid.options.editable = {
                mode: "popup", window: { title: "Add Server" }, template: kendo.template($("#popup-editor-servers").html())
            };

            grid.addRow();
        },