success and error ??
success and error ??
With $.ajax we get success: and error: options to trigger events as needed. I don't see these options for DataTable. I have tried using the load() function but I'm not getting it to work.
$(document).ready( function () {
$('#tableOne').dataTable( {
"bServerSide": false,
"bProcessing": false,
"sAjaxSource": 'http://ufpetl02a.edc.net/my.cgi'
} );
} );
$(tableDiv).load(function() { do something jqueryish... });
Is there a way to determine success and error?
Thanks,
Mike
$(document).ready( function () {
$('#tableOne').dataTable( {
"bServerSide": false,
"bProcessing": false,
"sAjaxSource": 'http://ufpetl02a.edc.net/my.cgi'
} );
} );
$(tableDiv).load(function() { do something jqueryish... });
Is there a way to determine success and error?
Thanks,
Mike
This discussion has been closed.
Replies
The way to check for success or error at the moment is to see if it works or not :-). If it doesn't break out Firebug and jsonlint.com...
So there currently isn't a way to do this other than to hack the DataTables code, or to wrap up your own Ajax call and pass it to DataTables as aaData (or fnAddData). However, I will look at abstracting out this function (like fnServerData does) for the next version.
Regards,
Allan
I am hoping to be able to pull server data, present and change it in dataTable, and post the changes back to the server. If anyone has done this already I would love to see the result.
Mike
No problem at all - thanks for bringing it up. This has come up once or twice before, so it makes sense to include, particularly while I'm working on an update just now.
fnServerData currently only has effect for server-side processing, but I think I will extend this to Ajax data loading as well, since the two data types can't be used at the same time.
Regards,
Allan
"fnInitComplete": function() {
$(loading).replaceWith(" ");
}
I didn't have success with fnServerData, but i'll probably try again.