Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm using JQuery SAjaxsource How can i Call a javascript function after SAjaxsource completes. I want to update a div after the completion of the datatable load.Please help me...

Edit:

$(document).ready( function() {
                var oTable = $('#example').dataTable( {

                    "bServerSide": true,
                                    "sSearch":false,
                                    "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
                                    "bPaginate": true,
                                    "bJQueryUI": true,
                                    "sPaginationType": "full_numbers",
                                    "sAjaxSource": "server_processingCDB1.php"
                } );
share|improve this question

2 Answers

up vote 1 down vote accepted

http://datatables.net/ref#fnDrawCallback also works for this, and saved you needing to override fnServerData.

share|improve this answer

take a look at the fnServerData option in the callbacks section of the help -> http://www.datatables.net/usage/callbacks

Gives you everything you need ... here some example code :

$(document).ready(function() {
    $('#example').dataTable( {
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "../examples_support/server_processing.php",
        "fnServerData": function ( sSource, aoData, fnCallback ) {
            $.getJSON( sSource, aoData, function (json) { 
                /* Do whatever additional processing you want on the callback, then tell DataTables */
                fnCallback(json)
            } );
        }
    } );
} );
share|improve this answer
sorry, i edited my question. how can i call a javascript function or how can i update a div – Arasu Sep 9 '11 at 11:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.