Grid with subgrid

Could you please tell me what is wrong with this xml. I am trying to build a grid with subgrid in PHP. If I output either $xml or $xmlSub independently my grid will populate properly, but when I try to nest them it does not work.



Can this be done dynamically or does it only work with xml files as sub grids?



public static function getTestSubGrid()

{

header(“Content-type: text/xml”);



//Sub grid xml

$xmlSub = ‘<?xml version="1.0" encoding="utf-8"?>’;

$xmlSub .= ‘’;

$xmlSub .= ‘’;

$xmlSub .= ‘Sub Grid Column 1’;

$xmlSub .= ‘’;

$xmlSub .= ‘Upstream’;

$xmlSub .= ‘’;



//Main grid xml

$xml = ‘<?xml version="1.0"?>’;

$xml .= ‘’;

$xml .= ‘’;

$xml .= ‘Click Me’;

$xml .= ‘’;

$xml .= ‘’;

$xml .= ‘’;



echo $xml;

}

In case of sub_row_grid usage, the value of the cell have to be only a URL to the configuration XML of the sub-grid. There is no possibility to insert sub grid xml directly to the main grid xml. If you want to load sub grid via xml string or any othe format you can use “onSubGridCreated” event:
mygrid.attachEvent(“onSubGridCreated”,function(sub,id,ind,value){
//sub - subgrid object
//value - value from XML for related cell
sub.loadXMLString(any necessary xml string)
//or mygrid.load("grid.xml�);
return false; //block default logic });