fnGetData - not working on dynamic data

fnGetData - not working on dynamic data

rajzamiteshrajzamitesh Posts: 4Questions: 0Answers: 0
edited December 2013 in General
the following code ( from http://datatables.net/api# )
[code]
// Individual cell data
$(document).ready(function() {
oTable = $('#example').dataTable();

oTable.$('td').click( function () {
var sData = oTable.fnGetData( this );
alert( 'The cell clicked on had the value of '+sData );
} );
} );
[/code]

shows the value of the row when clicking on it.
If the table is static (not fetched from server), it works fine.
But if the data is fetched from server, then it works only on the data that is shown on the first page.

If the number of records to show is changed, it does not work.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    > But if the data is fetched from server, then it works only on the data that is shown on the first page.

    See the top FAQ :-)
    http://datatables.net/faqs#events

    Allan
This discussion has been closed.