剑道网格编辑内联下拉列表不显示
Kendo Grid edit inline with dropdown list isn't show
我在使用网格内的下拉列表内联编辑剑道网格时遇到问题,这是我的屏幕截图
屏幕拍摄1->请看字段"图标"
当我单击图标的字段时,该字段更改为下拉列表喜欢这个屏幕截图2 在我单击字段图标后
,那么我该怎么办,如果我希望字段图标是单击前的下拉列表?
这是我的代码:
$("#customers").kendoDropDownList({
dataTextField: "pis_icon_url",
dataValueField: "pis_icon_id",
valueTemplate: '<span class="selected-value" style="background-image: url(''#:pis_icon_url#'')"></span>',
template: '<span class="k-state-default" style="background-image: url(''#:pis_icon_url#'')"'></span>',
dataSource: {
transport: {
read: {
dataType: "json",
url: "/api/icon-priority"
}
},
schema:{
data:'list'
}
},
height: 400
});
var dropdownlist = $("#customers").data("kendoDropDownList");
//in 字段:"pis_icon_id",请检查"模板",我已经在标签输入中添加了属性"id='customers'",但它不起作用
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
columns: [
{ field:"pis_priority_name",title:"Priority Name", width: "180px" },
{ field: "description", title: "Description", width: "380px" },
{ field: "pis_icon_id", title: "Icon", width: "300px",template:"<input id='customers' data-bind='value:pis_icon_id' style='width:100%;'>",
editor:categoryDropDownEditor
// "<div style='width: 100%;'><img src='#:pis_icon_url#' style='width: 22px;height: 22px;'> </div>"
},
{ field: "pis_priority_color", title: "Color",
width: "100px",
editor: function (container, options) {
$("<input type='color' name='"+options.field+"' data-bind='value:" + options.field + "' />")
.appendTo(container)
.attr("pis_priority_color", options.field)
.kendoColorPicker({
buttons: true
});
},
template: "<span style='display: inline-block; width: 50%; height: 50%; background-color: #= pis_priority_color #'></span>"
},
{ field: "is_default",
title: "Default",
width: "100px",
template:"<input name='is_default' class='ob-paid' type='checkbox' data-bind='checked: is_default' #= is_default? checked='checked' : '' #/> "
},
{ field: "active",
title:"Active",
template:"<input name='active' class='ob-paid' type='checkbox' data-bind='checked: active' #= active ? checked='checked' : '' #/> "
,width: "130px"
},
{ command: "destroy", title: " ", width: "150px" }],
editable: {
update:true
}
我能够使用 MVC 包装器并遵循这篇文章来让它工作:
http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration
关键是由于已知的 Kendo 网格错误而添加保存事件 - 在我看来,Kendo 文档应该提到这个问题。
我尝试使用 javascript 实现实现相同的逻辑,但无法使其工作。
相关文章:
- 如何在按钮中显示下拉列表中选定的元素
- 根据前两个下拉ID显示第三个下拉列表
- 根据用户从下拉列表中的选择显示多个文本框
- jQuery下拉列表未显示第一个选项
- AngularJS下拉列表未显示所选值
- 引导程序下拉列表显示不正确
- 使用2个下拉列表显示/隐藏分区
- 在html中显示任一下拉列表
- 选中复选框时如何显示/隐藏下拉列表
- 需要在 html 中使用两个下拉列表来显示不同的 json 值
- 显示基于第一个下拉列表的第二个下拉列表不起作用
- HTML 表单字段根据从下拉列表中选择的选项显示/隐藏
- 剑道网格编辑内联下拉列表不显示
- 选择下拉列表需要在选中时显示提供商的详细信息-无法通过我的脚本显示url
- 触发 html5 输入数据列表下拉列表显示
- 使用下拉列表显示/隐藏
- 通过选择一个下拉列表显示两个不同的值
- JavaScript链式下拉列表显示/隐藏一个Div
- 下拉列表显示[对象对象],而不是使用击倒值
- 加载时,剑道下拉列表显示DataValueField在DataTextField之前