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

[Solved] Collapsed rows on grouping

2 Answers 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
balticer
Top achievements
Rank 1
balticer asked on 18 May 2010, 12:42 PM
Dear,

it is possible to set all rows in collapse state if i select a column for grouping?

regards
Kai

2 Answers, 1 is accepted

Sort by
0
Nikolai
Top achievements
Rank 1
answered on 07 Apr 2011, 10:01 PM

I succeded by firing up the OnLoad Client event:

 

 

 

 

.ClientEvents(events =>
{
events.OnLoad("collapseMVCGroupedGrids");
})

 

 

 

 

 


and following JavaScript:

 

 

 

 

 

 

 

function collapseMVCGroupedGrids(e) {
var grid = $('#' + e.target.id);
$.each(
grid.find('td.t-group-cell').parent('tr'),
function(index, value) {
$(value).attr('style', 'display: none;');
} );
$.each(
grid.find('.t-icon'),
function(index, value) {
if ($(value).hasClass('t-collapse' )) {
$(value).removeClass('t-collapse')
.addClass('t-expand');
}
} );
}

 

 

 

 

 

 


 

 

 

 

 

 

 

 


Enjoy!

0
Henry
Top achievements
Rank 1
answered on 23 Nov 2011, 07:31 AM
It works fine!! Thank you very much!!

Henry
Tags
Grid
Asked by
balticer
Top achievements
Rank 1
Answers by
Nikolai
Top achievements
Rank 1
Henry
Top achievements
Rank 1
Share this question
or