Reload Ajx Data

Reload Ajx Data

btafoyabtafoya Posts: 4Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
How do you reload the data after the table has been initialized? I was unable to find a method in the documentation or the forums.

Like, for example, when a user clicks on a button I would like to reload the data via ajax..... Here is my datatable:

[code]
var user_list = jQuery('#user_list').dataTable( {
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"bAutoWidth": false,
"sAjaxSource": current_web_root + '?action=ajax|admin_user_list',
"aoColumns": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
{ "bSortable": false, "bSearchable": false }
]
});
[/code]

Thanks!

Replies

  • btafoyabtafoya Posts: 4Questions: 0Answers: 0
    Haha of course I resolve the issue after posting it! LOL!

    need to lose the "var" directive first, then user_list.fnDraw();

    [code]
    user_list = jQuery('#user_list').dataTable( {
    "sPaginationType": "bootstrap",
    "oLanguage": {
    "sLengthMenu": "_MENU_ records per page"
    },
    "bProcessing": true,
    "bServerSide": true,
    "bStateSave": true,
    "bAutoWidth": false,
    "sAjaxSource": current_web_root + '?action=ajax|admin_user_list',
    "aoColumns": [
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    { "bSortable": false, "bSearchable": false }
    ]
    });
    [/code]
This discussion has been closed.