How do I reference a subgrid XML inside my parent XML as a v

I�m trying to use a grid with a subgrid. My XML is stored in a session variable.



For example, lets say this is my parent or master xml:



var parentXML = ��;

parentXML += �<?xml version="1.0"?>�;

parentXML += ��;

parentXML += � �;

parentXML += � [***how do I reference subXML� variable here?***�;

parentXML += � Loaded by ajax�;

parentXML += � John Grisham�;

parentXML += � 12.99�;

parentXML += � 1�;

parentXML += � 24�;

parentXML += � 0�;

parentXML += � 05/01/1998�;

parentXML += � �;

parentXML += ��;



Let�s say that this is my detail XML:



var detailXML = ‘’ ;

detailXML += ’<?xml version="1.0" encoding="UTF-8"?> ’ ;

detailXML += ’ ’ ;

detailXML += ’ ’ ;

detailXML += ’ Status’ ;

detailXML += ’ User Level’ ;

detailXML += ’ User Type’ ;

detailXML += ’ ’ ;

detailXML += ’ px’ ;

detailXML += ’ ’ ;

detailXML += ’ ’ ;

detailXML += ’ ’ ;

detailXML += ’ Active’ ;

detailXML += ’ 1’ ;

detailXML += ’ Internal’ ;

detailXML += ’ ’ ;

detailXML += ’ ’ ;



I construct my grid:



mygrid.loadXMLString(parentXML, function(){

        mygrid.cells(“2”,0).open(); }) ;





Now my subgrid:



mygrid.attachEvent(“onSubGridCreated”, callback);

function callback(sgrid,id,ind,val)

{

sgrid.loadXMLString(detailXML);

// sgrid.enableAutoHeight(true); - enabled by default , so not really necessary

sgid.callEvent(“onGridReconstructed”,[]) //It must force size updates for all sub-grid hierarchy

return false;

}



My question is: how do I reference �detailXML� inside my parent �parentXML�?







There isn�t possibility to put sub grid xml string as you wish. In the xml structure you are able only to specify path to the xml file. If you want to load sub grid via xml string the only way to do it is to use �onSubGridGreated� event.