I am new to kendo and was trying to implement a custom editor for a Kendo grid column, which is a kendoAutoComplete.
I was successfully able to get the data from the backend, having enabled serverFiltering to true, but ultimately the data is not getting binded.
Here is the code:
Custom Editor Implementation:
$('<input class="auto-mat" data-value-field="MAT" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoAutoComplete({
autobind: true,
suggest: true,
filter: "contains",
minLength: 3,
dataTextField: "DES",
dataValueField: "MAT",
dataSource: new kendo.data.DataSource({
//serverFiltering: true,
transport: {
read: {
dataType: "odata",
url: utils.serverURL() + '&event=SEARCH&field=' + options.field,
data: {
value: function(){
return $('.auto-mat .k-input').data('kendoAutoComplete').value();
}
}
}
},
schema: {
data: function (response) {
return response.data;
}
}
})
});
And the data from the backend comes in this manner:
{"DATA":[{"MAT":"111","DES":"COAL"},{"MAT":"222","DES":"TEXT1"}]}
Please tell me where I am going wrong.