This is a migrated thread and some comments may be shown as answers.

DropDownList does not pick up data-option-label

6 Answers 992 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Jaap
Top achievements
Rank 2
Jaap asked on 07 Mar 2012, 04:38 PM
When I bind this element: <select data-role="dropdownlist" data-option-label="Select an item" />
the optionLabel is not used.
This is because optionLabel is not in the default DropDownList.options object.
If I add the field optionLabel: "" to it, then the attribute is used correctly.

Due to the way the binding is working all possible configuration options must be in the default options object of the widget else it will not be possible to read the attribute in kendo.initWidget.

I can imagine that is applies to other options and to other widgets also.

Regards, Jaap

6 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 08 Mar 2012, 12:36 PM
Hi,

 Right on target. We will fix that for the official release. Keep the great feedback coming!

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jaap
Top achievements
Rank 2
answered on 26 Mar 2012, 08:31 AM
I can confirm this is fixed in the release version.
Thanks, Jaap
0
Chaitali
Top achievements
Rank 1
answered on 04 Feb 2013, 12:24 PM
I'm sorry, it has a bug... kendoDropDownList.optionLabel

Thanks
0
Georgi Krustev
Telerik team
answered on 04 Feb 2013, 01:47 PM
Hi,

 
The described issue is already addressed and the fix is included in the last internal build of Kendo UI. I will suggest you give it a try.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kevin
Top achievements
Rank 1
answered on 19 Jun 2015, 08:07 PM

Can we bind data-option-label or template with observable ? 

 data-option-label="data-bind= html:varObservabel"

Or 

data-option-label="varObservable"

 

var viewModel = kendo.observable({

varObservable:"select somthing..."
      });

0
Georgi Krustev
Telerik team
answered on 24 Jun 2015, 02:36 PM
Hello Kevin,

Widget does not expose built-in MVVM binding for optionLabel update. I would suggest you implement a custom MVVM binding that tackles this functionality. Basically, it will need to update the optionLabel of the widget using its setOptions method.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MVVM
Asked by
Jaap
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Jaap
Top achievements
Rank 2
Chaitali
Top achievements
Rank 1
Georgi Krustev
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or