I am using kendo grid in my application. In that grid, I have used kendo drop down list. I have an array for datasource of that dropdownlist. The array looks like
var arr = [{text: "demo 1", value: 1}, {text: "demo 2", value: 2}]
My Dropdownlist Looks like:
$("#grid").kendoGrid({
dataSource: dataSource,
navigatable: true,
pageable: true,
height: 550,
filterable: {
mode: "row"
},
sortable: {
mode: "single",
allowUnsort: false
},
toolbar: ["create"],
columns: [
{ field: "Item", title: "Item", width: "300px", editor: categoryDropDownEditor }
],
editable: true
});
function categoryDropDownEditor(container, options) {
$('<input data-text-field="text" data-value-field="value" data-bind="value:' + options.field + '" />')
.appendTo(container)
.kendoDropDownList({
dataSource: arr,
autoBind: true,
dataTextField: "text",
dataValueField: "value",
});
}
It is showing the text in dropdown correctly but after selecting the option from drop down it shows object object as a selected text.
Attached the screenshot of the drop down selected value and after option after selecting Image of option selecting and After option selected
I have tried a lot of solutions but didn't work. It will be great if someone provides the solution.
Thanks