使用服务器端(node.js)将数据发布到数据表

时间:2018-07-07 21:36:46

标签: node.js datatable

将参数发送到服务器,并且客户端接收结果,但是数据未加载到数据表中。 显示以下消息: DataTables警告:表id = SS-请求的未知参数'0'为第0行。有关此错误的更多信息 请帮助我/

数据表1.10.19 /

节点版本10.5.0 /

javascript代码

At line 48 of file array2.f90 (unit = 1, file = 'xyfile.dat')
Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x7f7aa5786f3a
#1  0x7f7aa5787a45
#2  0x7f7aa57881bc
#3  0x7f7aa584b3a3
#4  0x7f7aa5846109
#5  0x4012f5
#6  0x40181a
#7  0x7f7aa50bdf44
#8  0x400c48
#9  0xffffffffffffffff

node.js代码

    <script>
    $(document).ready(function () {
        var myGrid = $('#SS');
        myGrid.DataTable
        ({
            bProcessing: true,
            bStateSave: true,
            bServerSide: true,
            bFilter: true,
            sDom: 'T<"clear">lftipr',
            aLengthMenu: [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
            bAutoWidth: false,
            sAjaxSource: "http://localhost:3000/GetData",
            fnServerData: function (sSource, aoData, fnCallback)
            {
                console.log(aoData);
                $.ajax
                ({
                    dataType: 'json',
                    type: "POST",
                    url: sSource,
                    data: JSON.stringify(aoData),
                    success: fnCallback
                });
            },
            aocolumns:
                [
                    {mDataProp: "name"},
                    {mDataProp: "number"},
                    {mDataProp: "workPlace"},
                    {mDataProp: "workPlace2"},
                    {mDataProp: "numberofPeople"},
                    {mDataProp: "Destination"},
                    {mDataProp: "day"}
                ],
            oLanguage:
                {
                    sUrl: "./dataTables.persian.txt"
                }

        });
    });
</script>

客户端错误 enter image description here

0 个答案:

没有答案