wrong documentation #fnGetData

wrong documentation #fnGetData

max4evermax4ever Posts: 45Questions: 0Answers: 0
edited August 2011 in DataTables 1.8
At http://www.datatables.net/api the documentation for fnGetData is right, but the code example is just saying contradictory things with the documentation and it doesn't work...

The code example should be something like this

[code]
/* 'open' an information row when a row is clicked on */
$('#visualizzazione tbody tr td img').live( 'click' , function () {
var row = $(this).closest('tr').get(0);

var aPos = oTable.fnGetPosition( row );
var aData = oTable.fnGetData( aPos );

oTable.fnOpen( row, aData[0], "info_row" );

/* Then when the info row is clicked upon - close it */
$('#visualizzazione .info_row').click( function () {
oTable.fnClose(row);
} );
} );
[/code]

Replies

  • robamacafrobamacaf Posts: 9Questions: 0Answers: 0
    I was looking around for ages trying to figure out why they wouldn't open! This fixed it. THANK YOU!
  • allanallan Posts: 61,824Questions: 1Answers: 10,131 Site admin
    Hi folks,

    I'm very sorry about that! There was a missing ".parentNode" from my example, which was needed to get the TR parent (another way would be use to the 'parents' method from jQuery). I've added this in now and made sure the example works!

    Regards,
    Allan
  • MemeDeveloperMemeDeveloper Posts: 5Questions: 0Answers: 0
    Allan, haha.
    Apologising for minor documentation mistakes - you sir are a legend !!!
    Thanks.
This discussion has been closed.