Row details assign DOM object and not html

Row details assign DOM object and not html

Tomas78Tomas78 Posts: 2Questions: 0Answers: 0
edited September 2010 in General
What I do not like in row details(http://datatables.net/examples/api/row_details.html) what data for Row Details method is assigned as html code. Is it possible to assign DOM object?

For example

function fnFormatDetails ( oTable, nTr )
{
var aData = oTable.fnGetData( nTr );
var sOut = document.getElementById(MyDiv);

return sOut;
}

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    What you can do is simply call fnOpen with an empty string for the details, and use the node which is returned by fnOpen (which is the new TR node) to append your element.

    [code]
    var nNew = oTable.fnOpen( nTr, '' );
    nNew.getElementsByTagName('td')[0].appendChild( MyDiv );
    [/code]
    Allan
This discussion has been closed.