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

Grouped Datasource in DropDown

2 Answers 80 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Ronny
Top achievements
Rank 1
Ronny asked on 16 Nov 2012, 11:52 AM
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 Answers, 1 is accepted

Sort by
0
Josh
Top achievements
Rank 1
answered on 22 Jul 2014, 08:43 PM
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.
0
Georgi Krustev
Telerik team
answered on 23 Jul 2014, 10:38 AM
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!
 
Tags
DropDownList
Asked by
Ronny
Top achievements
Rank 1
Answers by
Josh
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or