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

Listbox with Grouping

5 Answers 361 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Enrico
Top achievements
Rank 1
Enrico asked on 17 Sep 2018, 12:19 PM

Hi,

I'm trying to add a group in my listbox.

But seems my code below is not working.

It only shows unidentified.

$("#optional").kendoListBox({
                    connectWith: "selected",
                    dataTextField: "Name",
                    dataValueField: "Name",
                    selectable: "multiple",
                    template: myTemplate,
                    groupable: true,
                    toolbar: {
                        tools: ["transferTo", "transferFrom", "transferAllTo", "transferAllFrom"]
                    },
                    dataSource: {
                        transport: {
                            read: {
                                url: "getmember" + id,
                                dataType: "json"
                            },
                            schema: {
                                model: {
                                    fields: {
                                         Name : { type: "string" },
                                        Id: { type: "string" },
                                        Location: { type: "string" }
                                    }
                                }
                            }
                        },
                        group: {
                            field: "Location"
                        }
                    },
                    columns: [
                        {
                            field: "Name",
                            title: "Name"
                        },
                        {
                            field: "Location",
                            title: "Location"
                        }
                    ]
                });

5 Answers, 1 is accepted

Sort by
0
Enrico
Top achievements
Rank 1
answered on 17 Sep 2018, 12:24 PM

Correction:

It only shows undefined.

0
Enrico
Top achievements
Rank 1
answered on 18 Sep 2018, 05:24 AM

Hi, Any update?

Here's the sample dojo.

0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 20 Sep 2018, 10:36 AM
Hi, Enrico,

Unfortunately, the Kendo UI ListBox does not offer such functionality out of the box. If this functionality is important to you, I would suggest logging a feature request in our UserVoice forum. The most popular ideas get included in our future planning for implementation:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback?category_id=206113

Meanwhile, you can use the Kendo UI MultiSelect which features the desired grouping:

https://demos.telerik.com/kendo-ui/multiselect/grouping

Finally, I did try to bend the current design of the Kendo UI Listbox, to appear grouped, so you can use this approach if you desire, however, any such customizations always carry some risks.

https://dojo.telerik.com/IHuREfOK



Let me know if you have further questions.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Enrico
Top achievements
Rank 1
answered on 24 Sep 2018, 12:28 PM

Exactly what I need. Thank you very much!

I'm also done posting a feature request in UserVoice forum.

0
Alex Hajigeorgieva
Telerik team
answered on 26 Sep 2018, 06:53 AM
Hi, Enrico,

I am pleased to see that my suggestion helped.

I can see that the UserVoice item you created has already collected few votes and I wanted to update the forum thread with it in case anyone else is brought here so they can support it:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/35506312-add-ability-to-group-data-in-listbox

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ListBox
Asked by
Enrico
Top achievements
Rank 1
Answers by
Enrico
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or