DropDownList does not pick up data-option-label

7 posts, 1 answers
  1. Jaap
    Jaap avatar
    96 posts
    Member since:
    Oct 2012

    Posted 07 Mar 2012 Link to this post

    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
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 08 Mar 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Jaap
    Jaap avatar
    96 posts
    Member since:
    Oct 2012

    Posted 26 Mar 2012 Link to this post

    I can confirm this is fixed in the release version.
    Thanks, Jaap
  5. Chaitali
    Chaitali avatar
    5 posts
    Member since:
    Jan 2009

    Posted 04 Feb 2013 Link to this post

    I'm sorry, it has a bug... kendoDropDownList.optionLabel

    Thanks
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 04 Feb 2013 Link to this post

    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!
  7. Kevin
    Kevin avatar
    1 posts
    Member since:
    Apr 2015

    Posted 19 Jun 2015 Link to this post

    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..."
          });

  8. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 24 Jun 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready