the grid within some sub-grid

Hi,

I would like to create the grid, the grid have 3 sub-grid,the grid can load the title of sub-grid. The each sub-grid can load xml by own.such as sub-grid 1 loadXML 1.php, sub-grid 2 loadXML 2.php, sub-grid 3 loadXML 3.php …etc.

Could you give the suggestion and sample how to do it.

Thank you.
Kenneth

You may try to use onSubgridCreated method:
docs.dhtmlx.com/doku.php?id=dhtm … gridloaded

For example:

grid.attachEvent("onSubGridCreated",function(subgrid,rId,rInd){ subgrid.setHeader("A,B,C"); subgrid.setColTypes("ro,ro,ro"); subgrid.setInitWidths("100,100,100") subgrid.init(); if(rId=="1"){ subgrid.load("1.php") } if(rId=="2"){ subgrid.load("2.php") } ... return false; // block default behavior })

I used the pro version 3.0 , could you tell me I can use this function.

thank you.
kenneth

Hi ,

thank you for your reply. I used your sample. but it cannot show any interface to me. It may be the code has some problem. Could you help me to check this code what’s wrong.

dhxGrid = dhxLayout.cells("b").attachGrid();
    	dhxGrid.setImagePath("dht/grid/codebase/imgs/");
		dhxGrid.setSkin("dhx_skyblue");
		
		dhxGrid.attachEvent("onSubGridCreated",function(subgrid,rId,rInd){
		subgrid.setHeader("A,B,C");
		subgrid.setColTypes("ro,ro,ro");
		subgrid.setInitWidths("100,100,100")
		subgrid.init();
		if(rId=="1"){
		subgrid.load("1.php");
		}
		if(rId=="2"){
		subgrid.load("2.php");
		}
		if(rId=="3"){
		subgrid.load("3.php");
		}
		return false;  // block default behavior
		});

thank you for your help.
Kenneth

Please, open ticket at support.dhtmlx.com and provide a complete demo where the issue can be reconstructed.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/doku.php?id=othe … leted_demo