I'm using the code below for my combobox:
Calling the following code will return the value of the combox except when an item's "Title" starts with an integer such as "2012 resource item title...". In this case executing the code below returns the "Title" property instead of the "ResourceID" property.
$("#ResourcesList").kendoComboBox({
index: 0,
placeholder: "Search by title/description",
dataTextField: "Title",
dataValueField: "ResourceID",
filter: "contains",
template: '<
div
style
=
"padding: 10px;"
><
strong
>#= Title #</
strong
>' +
'<
div
style
=
"margin-top: 5px;"
class
=
"t1"
>#= Description #</
div
></
div
>',
dataSource: {
type: "jsonp",
serverFiltering: true,
serverPaging: true,
pageSize: 20,
transport: {
read: {
url: function (kcb) {
var strurl="/mysite/GetResourcesList?filtertext=" +
$("#ResourcesList").data().kendoComboBox.text();
return strurl;
}
}
}
}
});
Calling the following code will return the value of the combox except when an item's "Title" starts with an integer such as "2012 resource item title...". In this case executing the code below returns the "Title" property instead of the "ResourceID" property.
alert($("#ResourcesList").data("kendoComboBox").value())