Kendo UI Grid弹出窗口编辑 [英] Kendo UI Grid popup edit
本文介绍了Kendo UI Grid弹出窗口编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用最新的KendoUI版本.如何在Kendo ui网格中自定义弹出窗口? (可表格选项中的弹出").谢谢.
I'm using latest KendoUI version. How I can customize popup window in kendo ui grid? (editable: "popup" in table options). Thanks.
推荐答案
要在Kendo UI Grid中自定义弹出窗口,可以使用Grid的editable
属性:
For customize popup window in Kendo UI Grid, you can use editable
property of Grid:
editable: {
mode: "popup",
template: kendo.template($("#custom_editor").html())
}
----------------
<script type="text/x-kendo-template" id="custom_editor">
<div class="k-edit-label required">UserName : </div>
<input type="text" name="UserName" class="k-textbox">
.....
</script>
如果要在Grid中使用不同的弹出式编辑器进行创建和更新数据操作,则应为它们两者定义一个模板:
If you want to use different popup editors in a Grid for the Create and Update data operations, You should define a template for both of them :
editable: {
mode:"popup",
template: $("#template").html()
},
然后定义这样的模板:
<script type="text/x-kendo-template" id="template">
#if(data.isNew()) {#
#var createTemp = kendo.template($("\#createTemplate").html());#
#=createTemp(data)#
#} else {#
#var editTemp = kendo.template($("\#editTemplate").html());#
#=editTemp(data)#
#}#
</script>
<script type="text/x-kendo-template" id="createTemplate">
<div class="k-edit-label required">UserName : </div>
<input type="text" name="UserName" class="k-textbox">
.....
</script>
<script type="text/x-kendo-template" id="editTemplate">
<div class="k-edit-label">UserName : </div>
<input type="text" name="UserName" class="k-textbox" readonly="readonly">
.....
</script>
这篇关于Kendo UI Grid弹出窗口编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文