Function after ajax load

Function after ajax load

TonyFavillaTonyFavilla Posts: 3Questions: 0Answers: 0
edited May 2011 in General
Hello, i'm pretty new to javascript so please have mercy if my question is silly..
I'm using an ajax source, with sAjaxSource, and i need to retrieve the biggest value in a column so I use the simple: [code]
for ( var i=0 ; i<=oTableLocal.length ; i++ )
{
var aTrs = oTableLocal.fnGetData(i);
if (aTrs[17]>max) max=aTrs[17];
}
return max;
[/code]
The problem is that it starts before the ajax source is loaded so fnGetData returns null, how can I use this function only after the sAjaxSource has been fully loaded?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    fnInitComplete is the callback function which is run when the Ajax sourced data has been fully loaded: http://datatables.net/usage/callbacks#fnInitComplete

    Allan
This discussion has been closed.