Pass parameters to function fnReloadAjax()

Pass parameters to function fnReloadAjax()

blastorblastor Posts: 14Questions: 0Answers: 0
edited April 2012 in General
i can't pass the parameters to function fnReloadAjax() as sEcho, iColumns ecc...
someone could help me please?

Replies

  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    fnReloadAjax (as noted in its documentation) shouldn't be used with server-side processing (which you must be using if you are using sEcho etc). To reload the table with server-side processing, just call fnDraw .

    Allan
  • blastorblastor Posts: 14Questions: 0Answers: 0
    Thanks Allan, i have a problem, post my code:

    [code]
    $(document).ready(function(){
    $("#agggiornata").click(function(){

    $.ajax({
    url: "./scripts/add_column.php"
    });

    $oTable.fnDraw();

    });

    $oTable=$('#tabella1').dataTable({

    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "sDom": '<"H"Clr>t<"F"ip>',
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "scripts/server_processing.php",
    "aoColumns":[<?php echo ($mData); ?>]

    });

    });

    [/code]
    with this i create "aoColumns"
    [code]
    <?php
    @require ('.\scripts\colonne.php');
    $num = mysql_num_fields( $result );
    $mData="{\"mDataProp\":\"0\"},";
    for ($i=1; $i<$num;$i++){
    $mData=$mData."{\"mDataProp\":\"".$i."\", \"bVisible\":false },";
    }
    ?>
    [/code]

    button "agggiornata" calls "add_column" and add one column into a database[tested], but when calls .fnDraw() callback the old Draw without refresh, could you help me?
This discussion has been closed.