0

我有以下代码,我想在删除记录后刷新数据表。目前我必须手动刷新浏览器......我该怎么办?

<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>
4

1 回答 1

0

可以做任何事情,从从脚本级别自动重新加载页面,到运行将获取新数据并重新填充表的 AJAX 脚本。仅操作表本身并删除行,如果您当前将其从后端的数据库或数据集中删除,那么它不会在下一次加载时再次显示在前端,而只是删除整个暂时在视觉上排就足够了。但是还有其他策略要做。这一切都取决于后端的内容,您当前如何为您的桌子提供食物等。

于 2012-07-30T22:48:40.127 回答