Retrieve table info
Retrieve table info
nvillescas
Posts: 3Questions: 0Answers: 0
I'm trying to display the table information (i.e. "Showing 1-10 of 20") in an external div. I know you can customize the placement of "i" inside the sDom property, but that's not meeting my needs. Instead I have a div that resides in a completely different area of the web page that I'd like to show the table information and update whenever the table redraws.
For example:
[code]oTable = $('#datatable').dataTable(
{
'fnDrawCallback' : function()
{
$('.table_info').html(fnGetTableInfo);
}
});[/code]
In the above example, whenever the table gets redrawn, the ".table_info" div will update with the new table info (i.e. "Showing 1 - 10 of 20").
I can't find any type of function that will easily do this. Any help is greatly appreciated. Thanks!
For example:
[code]oTable = $('#datatable').dataTable(
{
'fnDrawCallback' : function()
{
$('.table_info').html(fnGetTableInfo);
}
});[/code]
In the above example, whenever the table gets redrawn, the ".table_info" div will update with the new table info (i.e. "Showing 1 - 10 of 20").
I can't find any type of function that will easily do this. Any help is greatly appreciated. Thanks!
This discussion has been closed.
Replies
Allan
For those interested, here's the solution:
[code]oTable = $('#datatable').dataTable(
{
'fnInfoCallback' : function(oSettings, iStart, iEnd, iMax, iTotal, sPre)
{
$('.table_info').html(sPre);
}
});[/code]