There are blank space at the bottom of the subgrid when it i


Hi,



I have created the sub grid of a grid by using the code below:







Thus, I am able to handle the events in the sub grid and it worked as expected. However, I met one problem is that when expand the row of main grid to see the data of subgrid, there are always a blank space at the bottom of the displayed subgrid. The error just happened at the first time of viewing the subgrid. If you collapse and expand the sub grid again it would be fine.



It would be a great help if you tell me how to resolve it.



Thanks & Regards,
Tam Le


Add next code to the subgrid creation

function initSubGrids(sgrid){

sgrid.loadXML(“sub_data.xml”,function(){
sgrid.callEvent(“onGridReconstructed”,[]); //will correct sub-grid size after data loaded in it
});

Thanks for your support so much. It works greatly now

Hi,

The solution doesn’t work when I load data for sub grid from a string instead of the  xml file

function initSubGrids(sgrid){
  …
  sgrid.loadXMLString(xmlString,function(){
       sgrid.callEvent(“onGridReconstructed”,[]); //will correct  sub-grid size after data loaded in it
  });

What should I do now ?
Thanks for your support so much !

Regards,
Tam

The loadXMLString is sync. command, which cause some pretty complex timing issues
To workaround issue, you can use next code in case of loadXMLString

sgrid.loadXMLString(xmlString);
window.setTimeout(function(){
sgrid.callEvent(“onGridReconstructed”,[]); //will correct sub-grid size after data loaded in it
},1)

My issue is resolved now. Thanks so much