Run a function after ajax request finished
Run a function after ajax request finished
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
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
This discussion has been closed.
Replies
Look at this link, http://datatables.net/ref
I think fnDrawCallback will suit to you
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.
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 :)