Grouped Datasource in DropDown

3 posts, 0 answers
  1. Ronny
    Ronny avatar
    1 posts
    Member since:
    Oct 2012

    Posted 16 Nov 2012 Link to this post

    Is it possible to use a grouped Datasource in the DropDownList? I just want to use the groups for something like optgroups in html selects.

    Thanks in advance.

  2. Josh
    Josh avatar
    69 posts
    Member since:
    Jun 2013

    Posted 22 Jul 2014 Link to this post

    Has there been an answer on this anywhere?

    For example, I would like to have a DropDownList use the "ipPart3" field from the following datasource for both the text and value in options:

    var ipPart3 = new kendo.data.DataSource({
        data: [{"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"134/32"},
    {"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"142/32"},
    {"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"131/32"},
    {"ip_part_1":"77","ip_part_2":"234","ip_part_3":"42","ip_part_4":"58/32"},
    {"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"129/32"},
    {"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"150/32"},
    {"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"149/32"},
    {"ip_part_1":"192","ip_part_2":"168","ip_part_3":"123","ip_part_4":"50/32"},
    {"ip_part_1":"10","ip_part_2":"200","ip_part_3":"211","ip_part_4":"10/32"}],
        schema: {
            model: {
                fields: {
                    ipPart1: {type: "string"},
                    ipPart2: {type: "string"},
                    ipPart3: {type: "string"}
                }
            }
        },
        group: [{field: "ipPart1"}, {field: "ipPart2"}, {field: "ipPart3"}]
    });



    .. but, I can't determine the way to specify the dataTextField & dataValueField options to get this to work.
  3. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3268 posts

    Posted 23 Jul 2014 Link to this post

    Hello Josh,

    Currently, Kendo UI DropDownList does not support binding to grouped data source. I would suggest you cast your vote for this functionality in the opened UserVoice discussion. We adjusts our road-map based on the top voted items.

    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