GroupBy problem

Hi,

I’m using the groupBy function to group my grid on a column.
However after loading, when I try to use the groupBy function again to group on a different column, or after filtering, all the ‘groupBy’ formatted header rows are lost. The grouping is actually performed its just these ‘groupBy’ formatted header rows that disappear.

Has anyone seen this behaviour? Is there a solution.

Before grouping rows by new column you should ungroup them dhtmlx.com/docs/products/dht … group.html

That doesn’t make any difference. Its really annoying because I can see that the grid is grouped correctly - it just hasn’t put in the group headings - see figures below:

Initial grouping using code

[code] // Initial Grouping for DB Record Data
mygrid.groupBy(3);
mygrid.setColumnHidden(3,true);
mygrid.setColumnHidden(4,false);

mygrid.customGroupFormat = function(text, count) {
    return "Record " + text + "; containing " + count + " related text segments";
};[/code]



There must be something preventing those headings getting displayed?

What version of dhtmlxGrid are you using? Can you provide code of re-grouping rows?

I’m using dhtmlxGrid v.2.5 Professional edition build 91111

I found that I couldn’t use

 <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_pro.js"></script>
 <script src="dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_splt.js"></script>
 <script src="dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_group.js"></script>

as it comes up with a memory error.

But using

<script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid.js"></script> <script src="dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_splt.js"></script> <script src="dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_group.js"></script>
or just

	<script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_pro.js"></script>

seems to work fine - except for the header problem on re-grouping.

The anchor tags i have in the page are:

<a href='javascript:groupBy(4);' > Group By Column</a>  <a href='javascript:groupBy(3);' > Group By Record ID</a>

with the javascript function:

[code]
function groupBy(ColId)
{
mygrid.unGroup();

// Group by column id, and hide the column
if (ColId == 4)
{	
	mygrid.setColumnHidden(3,false);

	mygrid.groupBy(4);

	mygrid.setColumnHidden(4,true);
	
	mygrid.customGroupFormat = function(text, count) {
	    return "Column '" + text + "'; containing " + count + " related text segments";
	};		
}
else
{	
	mygrid.setColumnHidden(4,false);
	
	mygrid.groupBy(3);

	mygrid.setColumnHidden(3,true);
	
	mygrid.customGroupFormat = function(text, count) {
	    return "Record " + text + "; containing " + count + " related text segments";
	};		
}

}[/code]

Any ideas on this problem?