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

ExpandRow on groupHeader click

6 Answers 357 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gaetano
Top achievements
Rank 1
Gaetano asked on 28 Jun 2013, 12:50 PM
Hi,
I have  a grid  and when grouped I can expand/collapse a group clicking on a small arrow on the left of the group header. I would like to expand/collapse the group clicking on any point of  the groupHeader not only on the small arrow.
There's some settings that i can use in order ti obtain that effect? or some workaround?

thanks

Fabio  

6 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 02 Jul 2013, 08:35 AM
Hi Fabio,

There are expandGroup() /  collapseGroup() methods from the Grid's API which can be used for this scenario.

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Fred
Top achievements
Rank 1
answered on 03 Apr 2017, 03:07 PM

I'm sorry but this answer doesn't help.

A groupHeader need to be expanded/collapsed, how to know the current state ? How to call collapseGroup() ?

A toggle function would have been a smarter approach.

I even have tried to call the click event attached to the groupHeader icon but it generate a stack overflow.

This doesn't work:

var grid = $("#grid").data("kendoGrid");
   grid.table.find(".k-grouping-row").each(function () {
    $(this).click(function(){    $(this).find('a.k-icon').trigger('click');   });
   });

 

I've wasted my day trying to enable a feature that should has been native.

I've asked arround and all my users have come with the same feedback: by default the full text of the group header is expected to be clickable !

 

So how am I supposed to solve this case ?

0
Konstantin Dikov
Telerik team
answered on 05 Apr 2017, 07:34 AM
Hi Fred,

For your convenience, following is a dojo example with the requirement that you have:
Please note that if you are using an older version you might need to change the jQuery selector for the collapse icon.


Best Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
answered on 09 Feb 2018, 06:38 PM

Hello Konstantin,

I use the Code in the sample here http://dojo.telerik.com/ijeVo to expand/collapse grouped rows - the only Problem with this solution is that it isn't possible to expand/collapse by click on the "arrow" which is use to expand/collapse without the Code here:

 

$(".k-grouping-row").click(function () {
                   var expanded = $(this).find(".k-i-collapse").length > 0;
                   if (expanded) {
                       e.sender.collapseGroup(this);
                   }
                   else {
                       e.sender.expandGroup(this);
                   }
               })

 

how to have the expand/collapse on the Group row and the arrow?

robert

0
Konstantin Dikov
Telerik team
answered on 13 Feb 2018, 12:04 PM
Hello Robert,

Since the arrow will still execute the toggling of the group, you need to add a condition that will not execute the custom logic when the arrow is clicked:
Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
answered on 13 Feb 2018, 12:07 PM
Perfect - Thank's
Tags
Grid
Asked by
Gaetano
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Fred
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Share this question
or