Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35271

reload table with ajax.url().load not working

$
0
0
function status_changed()
    {
        var value = document.getElementById("campaign_status").value;
        var table = $('#example').DataTable();
        var url = "../json/json.get_campaigns.php?filter=" + value;
        table.ajax.url(url).load();
    }


 $(document).ready(function()
    {
        var table = $('#example').DataTable( {
            "fnServerData": function ( sSource, aoData, fnCallback ) {
                $.ajax( {
                    "dataType": 'json',
                    "type": "POST",
                    "url": sSource,
                    "data": aoData,
                    "success": fnCallback
                } );
            },
            "sAjaxSource": "../json/json.get_campaigns.php?filter=Active",
...}

What I am basically trying to do is update the contents of a table based on the selected value in a combo box. I am trying to get it to reissue the json call with the new supplied url, but I can see in the chrome debugger that ajax.url(url) is not actually requesting the new URL, it is requesting the one thats defined in sAjaxSource.

Am I doing this the right way?


Viewing all articles
Browse latest Browse all 35271

Trending Articles