Get all Data table into an Array
Get all Data table into an Array
infantheartlyjes
Posts: 9Questions: 0Answers: 0
Hi, I having 25 records in my DataTable. I paginated with 5 records per page. I need all table records data as comma separated data in my array. For example i having 3 columns.
xxx yyy 1
eee fff 2
...
...
...
I need all data as xxx,yyy,1,eee,fff,2 ....... in a array variable? How can i do this ?
xxx yyy 1
eee fff 2
...
...
...
I need all data as xxx,yyy,1,eee,fff,2 ....... in a array variable? How can i do this ?
This discussion has been closed.
Replies
The documentation for fnGetData says:
> Get the data for the whole table, an individual row or an individual cell based on the provided parameters.
Sounds like that's what you want to me...
[code]$(document).ready(function() {
oTable = $('#example').dataTable();
oTable.$('table').click( function () {
var sData = oTable.fnGetData( this );
alert( 'The cell clicked on had the value of '+sData );
} );
} );[/code]
No - it returns it as an array. The alert() converts the array of comma delimited.