How to load recieved json directly to myTable?

How to load recieved json directly to myTable?

Alex_anderAlex_ander Posts: 11Questions: 4Answers: 0

Hello!
We have the following code to add new row to the table:

        $.ajax({
            url: "../datasource.php",
            type: "POST", 
            dataType: "html", 
            data: $('#myForm').serialize(),
            success: function(response) { 
                //var result = $.parseJSON(response);
                myTable.ajax.reload();
            },
            error: function(response) {
                console.log(response);
            }
        });

But our datasource.php returns a full dataset for the table. So we actually not need to reload data, its better to load received json (commented var result) directly to myTable without extra requests to server. How to do it?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.