Run a function after ajax request finished

Run a function after ajax request finished

merihmerih Posts: 24Questions: 0Answers: 0
edited March 2012 in General
Hello,

I would like to run a function after ajax request processing finished and datatable loaded.. Does anybody know which function helps me in this situation?

[code]

$('#orjMatchTable').dataTable( {
"bServerSide": false,
"bProcessing": true,
"bDeferRender": true,
"sAjaxSource": "../servlets/PublishedMatchedListServlet?matchTypeId="+id,
"sServerMethod": "GET",
"bRetrieve": true,
"sAjaxDataProp": "",
"aoColumns": [

{ "mDataProp": "systemId"},
{ "mDataProp": "leftEntityIdentity"},
{ "mDataProp": "leftEntityName"},
{ "mDataProp": "rightEntityIdentity"},
{ "mDataProp": "rightEntityName"},
{ "mDataProp": "startOfUse"},
{ "mDataProp": "dateModified"},
{ "sDefaultContent": "","fnRender": function(oObj) {
var sId = oObj.aData.systemId;
return "Scope";} }
],
"bRetrieve": true,
"bAutoWidth": false,
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 0,5,7 ] },
{ "sWidth": "15%", "aTargets": [ 5 ] },
{ "sWidth": "15%", "aTargets": [ 6 ] },
{ "sWidth": "15%", "aTargets": [ 7 ] }
],
"aaSorting": [[ 5, "desc" ]]
});

[/code]

Thanks

Replies

  • jinjungjinjung Posts: 24Questions: 0Answers: 0
    Hi merih,
    Look at this link, http://datatables.net/ref
    I think fnDrawCallback will suit to you
    Jinjung
  • merihmerih Posts: 24Questions: 0Answers: 0
    Hi Jinjung,

    Thank you for you response. I tried to use fnDrawCallback function. But It works twice. Before the load and after loaded.. Is there a way to control this.
  • merihmerih Posts: 24Questions: 0Answers: 0
    at the end I found the solition.. :)

    There is another function which is call fnInitComplete

    Related discussion below;
    http://www.datatables.net/forums/discussion/6576/datatables-table-loads-twice-first-time-without-table-data/p1

    Thanks :)
This discussion has been closed.