Hi,
I have a Kendo Drop down, displaying remote data (of type odata) implemented as follows:
$("#listDropDown").kendoDropDownList({
filter: "contains",
dataTextField: "displayName",
dataValueField: "fieldid",
optionLabel: "Please Select..."
dataSource: {
type: "odata-v4",
transport: {
read: function (options) {
$.ajax({
url: someURL,
dataType: "json",
success: function (result) {
options.success(result);
},
error: function (result) {
console.log(result);
}
});
}
}
}
});
the 'fieldId' in this case is of type GUID. The drop down is created successfully and displaying data on screen. Using the no data template i can also successfully add a new item and refresh the drop down to the item is available on the list.
I would like to dynamically set the selecteditem on the drop to the item that has just been added. I am using the following code.
$("#listDropDown").data("kendoDropDownList").value(newFieldId);
'newfieldId' is a GUID that has been returned by the ajax call which has just created the new item. This is getting a value successfully, however doesnt appear to work. I have also tried hard coding this to use a value which i know existsin the drop down which i pass in as a string as i would expect a GUID to and this still doesnt work. This leads me to believe i havent configured my drop down correctly for using the GUID as the datavalue field.
Can you confirm if this is the case?
Many thanks