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

Use the grouping option does not display the name of the first group

7 Answers 556 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Bridge24
Top achievements
Rank 1
Iron
Bridge24 asked on 27 May 2015, 07:20 PM

Hi,

I have to use the grouping option, but only after initialization of the dropdownlist like this: 

item.dataSource.group( { field: "category" })

It work, except for the first group, which is not shown.

I reproduced my issue in http://dojo.telerik.com/oMEQU.

 

 Also, is it possible to sort groups other than alphabetically. For example, by field "sortField" to get "Vegetables" first, then "Fruits", then "Meat" ? 

 

 

 

 

 

 

 

 

7 Answers, 1 is accepted

Sort by
1
Georgi Krustev
Telerik team
answered on 29 May 2015, 10:50 AM
Hello Dani,

The group header will be shown only if the whole data source is updated. You will need to use the setDataSource method for that task:
var ds = new kendo.data.DataSource({
  data: data,
  group: { field: "category" }
});
             
cust.setDataSource(ds);

Check the updated demo: http://dojo.telerik.com/@ggkrustev/iXUXi

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bridge24
Top achievements
Rank 1
Iron
answered on 29 May 2015, 12:26 PM
Thank you! It works. But what about sorting ?  Is it possible to sort groups other than alphabetically?
0
Georgi Krustev
Telerik team
answered on 02 Jun 2015, 10:04 AM
Hello Dani,

The group functionality of the DataSource component allows to sort ascending or descending the grouped source. You can find more details in the corresponding documentation: If you would like to sort the groups in a special way, then you will need to use server grouping and perform the operation on the server. To tell the component to skip grouping on the client, set serverGrouping to true.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bridge24
Top achievements
Rank 1
Iron
answered on 03 Jun 2015, 02:14 PM

Hi, 

Because of the structure of my project, I really can not perform grouping on the server. I thought about using a GroupTemplate to change the text of the groups, but I end up with the original problem of the header not replaced.

Example is here: http://dojo.telerik.com/EkUvE

0
Georgi Krustev
Telerik team
answered on 05 Jun 2015, 09:40 AM
Hello Dani,

I would suggest you update fixedGroupHeader too. Checked the updated demo:
Let me know if I am missing something in the described scenario.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bridge24
Top achievements
Rank 1
Iron
answered on 05 Jun 2015, 12:11 PM

Thank you for that information, using fixedGroupTemplate solves a part of the problem.  

But now, why are these 2 templates looks different?

The first group renders a <div> outside the ul-li zone, so, it uses the whole line, and the first "option" is under it.  And, it's not the same color!

For all others, the optiongroup is merged on the same line, and is rendered as a <div> inside the first <li> of each group.

It's strange that the first group doesn't have the same presentation as the other ones.

We'll be able to fix it by adjusting the padding and other CSS of both presentations to makes them look the same.  

But we don't understand why you did that, as they should be rendered the same way, first group or not!

I was able to "fix" your combo to make it run as expected, with that fix: (in settimeout section). I really think that it's a bug that should be fixed.  Or, maybe there is another reason why you make the first group display differently?

http://dojo.telerik.com/EGafE/7 

Thank you

0
Accepted
Georgi Krustev
Telerik team
answered on 09 Jun 2015, 10:21 AM
Hello Dani,

Your observations are correct. Basically, the widget has two group templates (as we already know) - one for the item (groupTemplate) and one fixed that shows the active group on scroll. To avoid to display two group titles at the beginning, the very first groupTemplate item (the one in the first LI element) is not rendered. You can observe the need of fixedGroupTemplate in our online demo.

What we can do is to enhance current behavior and allow to disable the fixedGroupHeader. Thus there will be no need to insert a group element manually. We will further investigate this functionality.
For now if you would like to disable the fixedGroupHeader, then you will need to use the mentioned approach.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
commented on 24 Oct 2022, 02:23 PM

The demo here doesn't seem to answer the issue. In the demo, "Argentina" is still missing the black flag for the category. 
Martin
Telerik team
commented on 26 Oct 2022, 08:01 AM

Hello, Lee,

That is the current design for the feature in the DropDownList. Please check this Dojo example as a possible approach to display the missing flag.

Tags
DropDownList
Asked by
Bridge24
Top achievements
Rank 1
Iron
Answers by
Georgi Krustev
Telerik team
Bridge24
Top achievements
Rank 1
Iron
Share this question
or