Reloading Table Issues

Reloading Table Issues

stilviastilvia Posts: 2Questions: 1Answers: 0
edited August 2014 in Free community support

Hi all,

have integrated DataTables in the last week and I love it! Previously I use a select box and ajax to retrieve a complex output of html. I have tried to implement the below code. The issue is the datatables does not update the updated dom. When I filter results I loose all the data. Any help would be great.

$('#selector').on('change', function (){

        var form_data = $("#submitsearch").serialize();
        $.ajax({
            url: "homedata2.php",
            type: 'POST',
            data: form_data,
            success: function (data) {
              $('#example tbody').html(data);

            }
        });

    var table=$('#example').DataTable();

    table.rows().invalidate().draw();


        return false;
  });

Answers

This discussion has been closed.