Hi !
I'd like to know if it's possible to display the optionLabel as the first option of the DropDownList. I need this functionality to be homogeenous with other select components.
I also would like to know if it's possible to manage the "required" attribute if I create an option by myself without using the "optionLabel".
Thanks for your help.
5 Answers, 1 is accepted
I am not sure I understand your question very well. Basically, the optionLabel gets displayed as a first option by default. Also, the "required" validation rule works as expected when the optionLabel is selected. Would you please check this example and let me know if I am missing something?
Regards,
Alexander Popov
Telerik
Hello,
I have a similar need. I want all the values in the datasource to be presented without an optionLabel. I set default values on the create window. optionLabel's translate to null which I do not want to allow.
Rick
Can you share more details about your scenario and if possible - some code snippets?
Regards,
Alexander Popov
Telerik
I see in my code below that I am specifying an optionLabel text value.
I think that I want to have a default value and show its text.
Null is not permitted as a value here, and in other similar situations.j
Thanks,
Rick
$(
"#IssueType"
).kendoDropDownList({ dataSource: window.DataSource.IssueTypeDS,
autoBind:
true
,
dataTextField:
"IssueTypeName"
,
dataValueField:
"IssueType"
,
valuePrimitive:
true
,
optionLabel: localize(
"format"
,
"SelectType"
)
});
In case no option label is required, then I would recommend omitting the configuration option entirely:
$(
"#IssueType"
).kendoDropDownList({ dataSource: window.DataSource.IssueTypeDS,
autoBind:
true
,
dataTextField:
"IssueTypeName"
,
dataValueField:
"IssueType"
,
valuePrimitive:
true
});
Regards,
Alexander Popov
Telerik