Im using the following code to read from a database, output to json and transfer to my Kendo UI Combobox.
It works great. BUT i canĀ“t figure out how to do add a special item that is first in the list and is selectable.
I would like to add "No Project" and it should be selected as default. It should be on top of the list.
var project = $("#project").kendoComboBox({
filter: "contains",
height: 300,
//text: "No Project",
//value: "",
autoBind: false,
suggest: true,
highLightFirst: false,
placeholder: "Select project...",
dataTextField: "DBText",
dataValueField: "DBValue",
template: '<span class=\"comboList\">${ data.DBText }</span>',
change: ProjectonChange,
dataSource: {
type: "json",
serverFiltering: false,
transport: {
read: "ListCustomers.cshtml?list=project&uid=@QueryUserId"
}
}
}).data("kendoComboBox");