Row details assign DOM object and not html

Row details assign DOM object and not html

smitchellsmitchell Posts: 3Questions: 0Answers: 0
edited April 2013 in General
I'm trying to get the example from the forums to work

http://www.datatables.net/forums/discussion/2812/row-details-assign-dom-object-and-not-html/p1

var nNew = oTable.fnOpen( nTr, '' );
nNew.getElementsByTagName('td')[0].appendChild( MyDiv );

I keep getting an error:
Uncaught Error: NotFoundError: DOM Exception 8

Replies

  • allanallan Posts: 63,175Questions: 1Answers: 10,409 Site admin
    Looks like it should work to me. Can you link to a test case please: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • smitchellsmitchell Posts: 3Questions: 0Answers: 0
    test case link
    http://www.vprco.com/tracking/orders

    if you send me an email I can send you the login

    thanks
    Sean
  • smitchellsmitchell Posts: 3Questions: 0Answers: 0
    test case link
    http://live.datatables.net/ipayul/edit#javascript,html

    Thanks
  • allanallan Posts: 63,175Questions: 1Answers: 10,409 Site admin
    edited May 2013
    It doesn't look like your live.datatables.net example is doing very much, as there isn't a table called #datatable. If I add such a table, then I get a Javascript error when trying to open a row due to this line:

    > oTable.getElementsByTagName('td')[0].appendChild('order_details');

    And right enough, getElementsByTagName is not a DataTables or jQuery API method. Do you not want something like `$('td', nNew).append( 'order details' )` ?

    Allan
This discussion has been closed.