在这里将问题作为答案发布后,我通过创建新问题来纠正此问题.
我正在尝试在kendo网格中创建行过滤器,以显示该列中可能值的DropDown.到目前为止,我得到的最接近的是Pluc 在链接问题中的例子.它仍然没有按预期工作.
在kendoGrid的列中,我定义了一个这样的字段:
{
field: "Herkunft",
title: "Herkunft",
width: "120px",
type: "string",
filterable:
{
cell:
{
showOperators: false,
template: herkunftDropDownEditor
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是herkunftDropDownEditor函数:
function herkunftDropDownEditor(element) {
element.kendoDropDownList({
autoBind: false,
optionLabel: "--Select Value--",
dataTextField: "Value",
dataValueField: "Value",
valuePrimitive: true,
dataSource: herkunftDataSource
});
}
Run Code Online (Sandbox Code Playgroud)
和下拉列表的数据源:
var herkunftDataSource = new kendo.data.DataSource({
data: [
{ Value: "Choice One" },
{ Value: "Choice Two" }
]
});
Run Code Online (Sandbox Code Playgroud)
它不起作用.我在Chrome中遇到的JS错误就行了:
element.kendoDropDownList({
Run Code Online (Sandbox Code Playgroud)
错误说:"Uncaught TypeError: undefined is not a function".由于某种原因它不能使用kendoDropDownList函数.
我也觉得令人困惑的是Telerik在他们的例子中使用模板template: …