cannot use method groupBy()

Hello,

while using the following files in HEAD section :
dhtmlx.js (version PRO 3.0)
dhtmlxgrid_splt.js
dhtmlxgrid_group.js

my grid fails to load and I get the following message in FireBug : “too much recursion” => dhtmlx.js line 1292
Then I have to manually “crash” my web browser (FF 18.0.2)

Here’s the code which triggers the grid :

[code]report_grid = report_cell.attachGrid();
report_grid.setImagePath("…/includes/js/dx/imgs/");
report_grid.setHeader(“fam1,Catégorie,Ref,Label,Qty Sold,Sales,Stocks,StockMin”);
report_grid.setInitWidths(“70,120,120,*,80,100,80,80”);
report_grid.setColAlign(“left,left,left,left,center,right,center,center”);

report_grid.setColTypes(“ro,ro,ro,ro,ron,ron,ron,ron”);
report_grid.setColSorting(“na,str,str,str,int,int,int,int”)
report_grid.enableSmartRendering(false);
report_grid.setNumberFormat(“0,000.00 €”,5,","," ");
report_grid.setColumnHidden(0, true);
report_grid.attachEvent(“onXLS”, function() {
document.getElementById(‘cover’).style.display = ‘block’;

})

// Build the params string
data = “products”;
var params;
params = “period=2013”;
// url
url = “…/controller/ctrlproducts.php?data=”+data+"&"+params+"&etc="+ new Date().getTime();

report_grid.loadXML(url, function() {});
report_grid.init();
report_grid.attachEvent(“onXLE”, function() {
document.getElementById(‘cover’).style.display = ‘none’;

})[/code]

If I remove the dhtmlxgrid_splt.js and dhtmlxgrid_group.js files, no problems.

But I can’t use the groupBy() and unGroup() methods.
(I’d like to group on col1).

Can you please help me please ?

Regards

found it !

Actually, It looks like I didn’t need to load the ext js files.

However, where can I find some detailed documentation about how to use the 2nd (optional) parameter in groupBy() method ?

The present doc says :
mygrid.groupBy(2,["#stat_max","#title","","#stat_total","","#cspan","#cspan","#cspan"]);

where 2nd parameter is an array.

So what’s in this array ? each value is mapped to a column.

What I’m trying to do is to get the Total Sales on each group name line

example :
+Categ1 (99) Total Sales = 123456,00 €
+Categ2 (24) Total Sales = 11111,00 €
etc

Can I do this with the 2nd parameter ?

regards

Please, try to use the second parameter of the groupBy() method.
For example:

grid.groupBy(1,["#stat_max","#title","","#stat_total","","#cspan","#cspan","#cspan"]);

docs.dhtmlx.com/doku.php?id=dhtm … ct_groupby

If issue still occurs - please, provide a complete demo where the issue can be reconstructed so we can provide you a proper solution

OK thanks.
Now it works.
Regards.