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

8 posts, 1 answers
  1. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 27 May 2015 Link to this post

    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" ? 

     

     

     

     

     

     

     

     

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 29 May 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 29 May 2015 in reply to Georgi Krustev Link to this post

    Thank you! It works. But what about sorting ?  Is it possible to sort groups other than alphabetically?
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 02 Jun 2015 Link to this post

    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!
     
  6. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 03 Jun 2015 in reply to Georgi Krustev Link to this post

    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

  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 05 Jun 2015 Link to this post

    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!
     
  8. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 05 Jun 2015 in reply to Georgi Krustev Link to this post

    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

  9. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 09 Jun 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready