未捕获的TypeError:无法读取属性' length'未定义的jquery数据表

时间:2014-06-30 09:55:31

标签: javascript jquery datatables

我在jquery中处理数据表时收到此错误。我的代码看起来像这个

<table id="user" class="display" cellspacing="0" width="100%">

        <thead>
            <tr>
                <th>User</th>
                <th>ComputerName</th>
                <th>Pid</th>
                <th>ProcessName</th>
                <th>Id</th>
                <th>WindowsUser</th>
                <th>ConnectionDate</th>
                <th>Type</th>
            </tr>
        </thead>

    </table>


<script src="~/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="~/Scripts/DataTables-1.10.0/jquery.dataTables.js" type="text/javascript"></script>
<script src="~/Scripts/DataTables-1.10.0/jquery.dataTables.min.js" type="text/javascript"></script>



<script type="text/javascript">
    @*var url = @create*@
    $(document).ready(function () {
        $('#user').dataTable({
            "bProcessing": false,
            "bAutoWidth": false,
            "bFilter": true,
            "bSort": true,
            "bDestroy": true,
            "bDeferRender": true,
            "sAjaxSource": "http://localhost:58413/api/User/GetUserSession?brokerName=DEMO-DM&datasourceName=GPON-FILLE&user=ADMIN",
            //"fnInitComplete": function (oSettings) {
            //    debugger;
            //}, 
            "aoColumns": [
                { "mData": "User" },
                { "mData": "ComputerName" },
                { "mData": "Pid" },
                { "mData": "ProcessName" },
                { "mData": "Id" },
                { "mData": "WindowsUser" },
                { "mData": "ConnectionDate" },
                { "mData": "Type" }

            ]
        });
    });

我在互联网上尝试了很多可用的解决方案但它不起作用。请任何人帮助我。

0 个答案:

没有答案