我有剑道代码:
<kendo:grid-columns>
<kendo:grid-column width="auto" title="<label style='color:white;'>Code</label>" field="code"/>
<kendo:grid-column width="auto" title="<label style='color:white;'>Category</label>" field="Category"/>
<kendo:grid-column width="auto" title="<label style='color:white;'>Sub Category</label>" field="SubCategory"/>
<kendo:grid-column width="auto" title="<label style='color:white;'>Description</label>" field="desc"/>
<kendo:grid-column width="auto" title="<label style='color:white;'>Value</label>" field="budget" template="#=kendo.toString(budget,'n0')#"/>
<kendo:grid-column title=" " width="175px">
<kendo:grid-column-command>
<kendo:grid-column-commandItem name="edit"/>
<kendo:grid-column-commandItem name="delete"/>
</kendo:grid-column-command>
</kendo:grid-column>
代码、类别、子类别
输入值为textfield
,值为numericupdown
。如何将 Category
和 Sub Category
更改为 comboBox
?
我尝试学习这个Overview Kendo UI ComboBox 。但情况不同,当我使用kendoGrid时,我真的不明白。
最佳答案
如果你使用jsp正确标记它,我假设你是java。
I have try learn this Overview Kendo UI ComboBox. but that is different case, when I used kendoGrid, I really don't understand.
如果是这样,您正在查看文档中的错误位置。
现在要重新表述您的问题,您希望在插入/编辑期间有一个编辑器来下拉特定列。
指定列的自定义编辑 UI。使用容器参数创建编辑 UI。
<kendo:grid-column title="Category" field="category" editor="categoryDropDownEditor" template="#=category.categoryName#"width="180px"/>
这是 JavaScript 方法
<script>
function categoryDropDownEditor(container, options) {
$('<input data-text-field="categoryName" data-value-field="categoryId" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: {
transport: {
read: "${categoriesUrl}"
}
}
});
}
</script>
通过花时间阅读文档来确保您清除基本概念
查看描述列类型的文档。 Editor java.lang.String
关于java - 在 Kendo 添加组合框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42104259/