dhtmlx sub grid loading from XML

Hi,



While trying to populate a grid with subgrid using XML file, we need to refer to a subgrid XML using it’s name. Is there any way where we can use an XML string to load subgrid also.



To explain more, can we call loadXMLString function at the place where we provide the name of the XML file to be loaded into the subgrid.



We want to use something like



loadXMLString(“subgrid.xml”)



instead of



subgrid.xml



Regards,

Gaurav Arora

Grid provides onSubGridCreated event which can be used to customize sub-grid loading

grid.attachEvent(“onSubGridCreated”,function(sub,id,ind,value){
//sub - subgrid object
//value - value from XML for related cell
sub.loadXMLString(any necessary xml string)
return false; //block default logic
});

Hi,

The above suggestion worked but the nested grid is hardly visible. It looks like it is inside a very small div. Please suggest. Following is the code snippet that may be useful…

      <DIV id=gridbox style=“BACKGROUND-COLOR: white” height=“300px”
      width=“560”>



Thanks,
Gaurav Arora

Please try to use

function callback(sgrid,id,ind,val)
{
sgrid.loadXMLString(subXML);
// 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;
}