Use of <cell type="sub_row_grid"> and <cell type="sub_row_gr

Currently there is an example which shows the use of .xml and .txt file as sub grid. How can I use dynamically generated xml data as a sub grid?

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.load(url) return false; //block default logic });