I have grid with a column bound like this...
cols.Bound(m => m.Location).Filterable(fl => fl.Cell(c => c.Template("locationFilter").Operator("equals").ShowOperators(false)));
and some javascript..
var locationList = [
{text: "Atlanta", value: "ATL"},
{text: "Houston", value: "HOU"},
];
function locationFilter(container) {
container.element.kendoDropDownList({
dataTextField: "text",
dataValueField: "value",
optionLabel: { text: "-ALL-", value: "" },
dataSource: { data: locationList, },
});
}
This seems to initialize correctly showing '-ALL-' with no filter applied. But as soon as I select something in the dropdownlist it immediately changes the selection back to "-ALL-" and filters out all the items.
However, if I change it to this and use strings for the data instead of objects, it lets me select items and applies the filters ok but the display isn't optimal...
function locationFilter(container) {
container.element.kendoDropDownList({
optionLabel: "-ALL-",
dataSource: {data: ["ATL", "HOU"],},
});
}
Am I doing something wrong when trying to use objects in the datasource for the custom filter, or is there a bug?
cols.Bound(m => m.Location).Filterable(fl => fl.Cell(c => c.Template("locationFilter").Operator("equals").ShowOperators(false)));
and some javascript..
var locationList = [
{text: "Atlanta", value: "ATL"},
{text: "Houston", value: "HOU"},
];
function locationFilter(container) {
container.element.kendoDropDownList({
dataTextField: "text",
dataValueField: "value",
optionLabel: { text: "-ALL-", value: "" },
dataSource: { data: locationList, },
});
}
This seems to initialize correctly showing '-ALL-' with no filter applied. But as soon as I select something in the dropdownlist it immediately changes the selection back to "-ALL-" and filters out all the items.
However, if I change it to this and use strings for the data instead of objects, it lets me select items and applies the filters ok but the display isn't optimal...
function locationFilter(container) {
container.element.kendoDropDownList({
optionLabel: "-ALL-",
dataSource: {data: ["ATL", "HOU"],},
});
}
Am I doing something wrong when trying to use objects in the datasource for the custom filter, or is there a bug?