We have data bound to a combox, all is working fine. When the user clicks the dropdown the list of items appears and is showing data assigned by the template -> template: "#=FirstName # #=LastName #, #=CompanyName #",
However, once the user selects something the datatextfield is shown, where as we want the same template shown. How can we do this?
Thanks - here is our code.
$(this).kendoComboBox({
placeholder: "Select A Client...",
//dataTextField: 'LastName',
dataValueField: 'ContactID',
template: "#=FirstName # #=LastName #, #=CompanyName #",
filter: "contains",
autoBind: false,
minLength: 3,
text: $(this).attr('data-text'),
dataSource: {
type: "odata",
serverFiltering: true,
serverPaging: true,
page: 1,
pageSize: 50,
sort: { field: "Name", dir: "asc" },
filter: filter,
transport: {
read: {
url: "/ajax/comboContactFilter.json",
}
}
}
});
However, once the user selects something the datatextfield is shown, where as we want the same template shown. How can we do this?
Thanks - here is our code.
$(this).kendoComboBox({
placeholder: "Select A Client...",
//dataTextField: 'LastName',
dataValueField: 'ContactID',
template: "#=FirstName # #=LastName #, #=CompanyName #",
filter: "contains",
autoBind: false,
minLength: 3,
text: $(this).attr('data-text'),
dataSource: {
type: "odata",
serverFiltering: true,
serverPaging: true,
page: 1,
pageSize: 50,
sort: { field: "Name", dir: "asc" },
filter: filter,
transport: {
read: {
url: "/ajax/comboContactFilter.json",
}
}
}
});