Subgrid custom loaded with additional header/footer

Using onSubGridCreated event to retrieve XML grid data and parse. Works fine except if the XML grid data contains attachHeader and attachFooter. The row height for the subgrid initializes to the height of the subgrid without the additional header/footer, but is the correct height after collapsing the row and re-expanding. If I remove the calls the initial height is perfect.

Anyway to force the row height to include the subgrid header/footer height from the attachHeader/attachFooter calls?

Code:
mygrid.attachEvent(“onSubGridCreated”,function(subgrid,id,ind,data)
{
var xml_data = getData( id ); // uses dhtmlxAjax to retrieve XML data
subgrid.parse( xml_data );

  mygrid.setSizes();
  subgrid.setSizes();

  return false; // prevent default behavior

});

XML data contains the header and row data plus:
[…list of params here…]
[…list of params here…]

Try to call attachFooter and attachHeader method on section:

<beforeInit><call command='attachHeader'>[...list of params here...]</call> <call command='attachFooter'>[...list of params here...]</call> </beforeInit>

Unfortunately neither or work. It’s like the initial height is calculated before the attachHeader/attachFooter calls. But after collapsing and expanding, the height is correct.

Unfortunately we cannot reproduce this issue locally. Please open ticket at support.dhtmlx.com/ and send us complete example where we can reproduce it.

I discovered a fix that works. Not sure if it has negative ramifications or maybe it is a bug fix. I changed a line in dhtmlxgrid_excell_sub_row.js in the function _expandMonolite(). Here is the snippet with the change:

	else {
		var d=document.createElement("DIV");
		row.oldHeight=td.offsetHeight;
		d.ctrl=td;
		if (td._sub_row_type)
			that._sub_row_render[td._sub_row_type](that,d,td,c);
		else
			d.innerHTML=c;
		d.style.cssText="position:absolute; left:0px; top:0px; overflow:auto; font-family:Tahoma; font-size:8pt; margin-top:2px; margin-left:4px;";
		d.className="dhx_sub_row";
		that.objBox.appendChild(d);
		[b]that._detectHeight(d,td,td._sub_grid.objBox.scrollHeight+td._sub_grid.hdr.offsetHeight+(td._sub_grid.ftr?td._sub_grid.ftr.offsetHeight:0));  // old code: that._detectHeight(d,td)[/b]			
	}

At that point, the subgrid size is set and by passing it to the _detectHeight function, the parent grid’s row is sized correctly.