wrong documentation #fnGetData
wrong documentation #fnGetData
max4ever
Posts: 45Questions: 0Answers: 0
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]
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]
This discussion has been closed.
Replies
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
Apologising for minor documentation mistakes - you sir are a legend !!!
Thanks.