0

I have the following code and I want to refresh the datatable ater I deleted the record. Currently I have to refresh browser manually ...what can I do?

<script type="text/javascript" charset="utf-8">
    $(document).ready(function () {
    var oTable = $('#example').dataTable({
        "bProcessing": false,
        "bServerSide": true,
        "sAjaxSource": "server_processing.php",
        "aoColumns": [{
            "bVisible": true
        }, {}, {}, {}, {}]
    }).makeEditable({
        sUpdateURL: function (value, settings) {
            console.log(value, settings);
            oTable.fnDraw();

            return (value); //Simulation of server-side response using a callback function
        },
        sDeleteURL: "DeleteData.php",
        "aoColumns": [{
            cssclass: 'required'
        }, {
            indicator: 'Saving platforms...',
            tooltip: 'Click to edit platforms',
            type: 'textarea',
            submit: 'Save changes'
        }, {
            indicator: 'Saving Engine Version...',
            tooltip: 'Click to select engine version',
            loadtext: 'loading...',
            type: 'select',
            onblur: 'cancel',
            submit: 'Ok',
            loadurl: 'EngineVersionList.php',
            loadtype: 'GET'
        }, {
            indicator: 'Saving CSS Grade...',
            tooltip: 'Click to select CSS Grade',
            loadtext: 'loading...',
            type: 'select',
            onblur: 'submit',
            data: "{'':'Please select...', 'A':'A','B':'B','C':'C'}"
        }]
    });
});
        </script>
Asim Zaidi
  • 27,016
  • 49
  • 132
  • 221

1 Answers1

0

Any number of things can be done, anything from, reloading the page automatically from a script level, to running an AJAX script that will get the fresh data, and repopulate the table. To just manipulating the table itself and removing the row, if your currently getting it to delete from the database or dataset you have on your backend, then it wont show up on the front end again on the next load, with that just removing the entire row visually for the time being will sufice. But theres other tactics to be done as well. It all depends on whats on the backend, how you feed your table currently etc.

chris
  • 36,115
  • 52
  • 143
  • 252