After posting question as answer here, I correct this by creating new question.
I'm trying to create row filter in kendo grid to appear as DropDown of possible values in that column. So far, closest I got is Pluc's example in linked question. Still it doesn't work as intended.
In columns of kendoGrid I defined a field like this:
{
field: "Herkunft",
title: "Herkunft",
width: "120px",
type: "string",
filterable:
{
cell:
{
showOperators: false,
template: herkunftDropDownEditor
}
}
}
This is herkunftDropDownEditor function:
function herkunftDropDownEditor(element) {
element.kendoDropDownList({
autoBind: false,
optionLabel: "--Select Value--",
dataTextField: "Value",
dataValueField: "Value",
valuePrimitive: true,
dataSource: herkunftDataSource
});
}
And datasource for the dropdownlist:
var herkunftDataSource = new kendo.data.DataSource({
data: [
{ Value: "Choice One" },
{ Value: "Choice Two" }
]
});
It doesn't work. The JS error I get in Chrome is on the line:
element.kendoDropDownList({
error says: "Uncaught TypeError: undefined is not a function".
For some reason it can't use kendoDropDownList function.
What I also find confusing is the way Telerik use template in their example: template: "#=FirstName# #=LastName#"
The way they do it is connecting the function to ui
instead of template
. I tried this approach also, calling ui: herkunftDropDownEditor
instead of template: herkunftDropDownEditor
. This way there is no error, but it doesn't work. The search field is still textbox. When I debug in Chrome, I see that argument element
in the function is not even available.
No clue what I'm doing wrong.