Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82039

Is there any contract when overriding "fnServerData" in dataTable settings

$
0
0
Hi Allan,

When I looked into the comments for "fnServerData" callback and the source code of the default one provided in dataTable.defaults, I am not sure if we have to adhere to any contract when providing this callback in my own dataTable settings, such as:
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
    // ...
}
1. Do I need to explicitly invoke fnCallback(json) in $.ajax success callback?
2. Do I need to explicitly trigger “xhr" event in $.ajax success callback?
$(oSettings.oInstance).trigger('xhr', [oSettings, json]);
3. Do I need to set oSettings.jqXHR?
4. Anything else I need to pay attention to / adhere to?
5. Any best practice to provide this option in dataTable settings?

Thanks & regards,
Roy

Viewing all articles
Browse latest Browse all 82039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>