optgroup from html source, not datasource

2 posts, 1 answers
  1. Ace
    Ace avatar
    56 posts
    Member since:
    Jan 2009

    Posted 04 Jun 2015 Link to this post

    Hi, I tried the new optgroup feature that way, and it is not working:


    The optgroup is rendered as an "undefined" block.

    According to that blog post, you supports dropdownlist option group.

    But... for now, we are unable to sort them in "our" order, that is not alphabetical, from data source.

    Also, we are unable to load them directly from the "html source" (select / optgroup / option)... 

    To be clear, we have 3 groups, and the name of these groups have nothing to do with alphabetical order.  Also, our customer can change its UI Language, so that text can change when our user change its ui language.  But, the logical order or the groups must stay the same, even if they are displayed in french, english, spanish, ... 

    Do you have plans to supports the option groups directly from the "<select>" source?  

    Or to "correctly" allow us to load them from data source, by providing a third "field" that allow us to manage order, independent of the displayted text?

    Thank you.

  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 05 Jun 2015 Link to this post


    The support for a grouped data source has been added since Q1 2015, but the data inferring from a grouped SELECT element was added later (logged issue). That being said, the next internal build / next official release will include that functionality.

    The inferring process basically means that we generate an object with 3rd field that represent the optgroup label value. As the grouping is based on sorting, the grouped DropDownList will be either "asc" or "desc" sorted. It will not be able to persist the custom optgroup order.

    If you would like/need to keep the custom optgroup order, then you will need to infer the data manually and then group the data manually (the serverGrouping option allows to define the groups manually).

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top