Get cell data
Get cell data
desidoc
Posts: 13Questions: 0Answers: 0
Hi,
i have the following code but it doesn't return the value. ¿Can anyone help me?
Thanks
$('#dataTable').on('click', 'td', function(event) {
var sData = $('#dataTable').fnGetData( this );
alert( 'The cell clicked on had the value of '+sData );
} );
i have the following code but it doesn't return the value. ¿Can anyone help me?
Thanks
$('#dataTable').on('click', 'td', function(event) {
var sData = $('#dataTable').fnGetData( this );
alert( 'The cell clicked on had the value of '+sData );
} );
This discussion has been closed.
Replies
Thanks
Should be: `$('#dataTable').dataTable().fnGetData( this );` .
> also is there anyway to know the value of a hidden cell?
Use fnGetData on the TR element and it will give you the data for the whole row.
Allan