jQuery.DataTables - fnAddData不起作用

时间:2014-06-09 10:25:03

标签: javascript jquery datatables

以下所有写入的数据表都没有填充数据:

HTML:

<table id="OrdersPending" class="row-border cell-border" cellspacing="0" width="100%">
<thead>
    <tr>
        <th>Login</th>
        <th>Route</th>
        <th>Date</th>
        <th>Time</th>
        <th>Points</th>
        <th>Done</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</tbody>
</table>

JavaScript的:

var ordersPending = $('#OrdersPending');
ordersPending.dataTable({
    "scrollCollapse": true,
    "paging": false,
    "bFilter": false,
    "bInfo": false,
    "jQueryUI": true
});
ordersPending.fnClearData();
ordersPending.fnAddData([['5', 'hjgjg', 'sglghsg', 'auiqri', 'afwkughfog', 'fefaf']]);

1 个答案:

答案 0 :(得分:1)

我认为您应该在代码中删除一个if err := r.ParseMultipartForm(500); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } 。我看到有2 [。尝试改变它:

[