I am executing the inline add/edit. During inline add, I have a dropdown values which are pulled from database but when I click then not getting the default selected value in save operation, If change dropdown value and click on save then getting the dropdown value.
Thanks in advance.
1 Answer, 1 is accepted
0
Vladimir Iliev
Telerik team
answered on 16 Jun 2014, 08:48 AM
Hi,
In current case you should either set the "optionLabel" option of the dropDownList or set default value for current field in the dataSource "schema.model.fields". Please check the example below:
set the "optionLabel" of the dropDownList:
.kendoDropDownList({
optionLabel: "- please select -"
autoBind: false,
set "defaultValue" for the current field in the dataSource schema, equal to the first item in the list:
dataSource: {
schema: {
model: {
id: "ProductID",
fields: {
ProductID: { editable: false, nullable: true },
//example of setting defaultValue for complex field
Category: {
defaultValue: {
CategoryID: 1,
CategoryName: "Beverages"
}
},
//example of setting defaultValue for primitive field
EmployeeID: { defaultValue: 1},
Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!