how to group from a specific column, table autoloaded


I have an existing table which I am generating via PHP.

I put the table code as:

and the grid is starting to work.

My question is, using this type of method, how do I set the grid/table to group . my table is something like col1, col2 … col11, col12

I want to group by col1, and optionally if possible, use sum, avg , min , max etc on col11,col12
so that if it is all in collapsed state, it shows the group name and the sum, etc functions as desired.


Unfortunately you will have to call groupBy method after the calling an dhtmlxGrid:

mygrid = new dhtmlXGridFromTable(‘tblToGrid’);

Here is the example of the init:


Column 1 Column 2
11 value1
11 value2
11 value3

mygrid = new dhtmlXGridFromTable('tblToGrid'); mygrid.groupBy(1,["#stat_max","#title"]);

function doBeforeInit(){

function doAfterInit(){