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?

var xml_data = getData( id ); // uses dhtmlxAjax to retrieve XML data
subgrid.parse( xml_data );


  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 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");
		if (td._sub_row_type)
			d.innerHTML=c;"position:absolute; left:0px; top:0px; overflow:auto; font-family:Tahoma; font-size:8pt; margin-top:2px; margin-left:4px;";
		[b]that._detectHeight(d,td,td._sub_grid.objBox.scrollHeight+td._sub_grid.hdr.offsetHeight+(;  // 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.