首页 文章

自定义弹出编辑器 - Kendo UI网格

提问于
浏览
-1

是否可以为kendo网格设置用户定义的弹出编辑器?如果是,如何添加该编辑器?

当我点击网格上的编辑按钮时,我希望下面的编辑器弹出,

<div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header" style="padding-top: 10px;">
                </div>
                <div class="modal-body">


                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" ng-click="SaveZone()">Save</button>
                </div>
            </div>
        </div>
    </div>

1 回答

  • 0

    你需要像这样指定kendo模板:

    <script id="custom_editor" type="text/x-kendo-template">
        <div>
            <label> some label </label>
        </div>
        <div>
            <input type="text" name="Name" />
        </div>
    </script>
    

    请注意,需要使用name参数将输入正确映射到模型中的字段 .

    然后在你的网格中指定editable就像这样

    ...    
    editable: {
        mode: "popup",
        template: kendo.template($("#custom_editor").html())
    },
    ...
    

相关问题