为什么我的数据表实现不能与ColumnDefs正确工作


Why does my DataTables implementation not work correctly with ColumnDefs?

我正在使用DataTables服务器端从我的MySQL表生成一个分页表。

我试图使用columnDefs选项将第一列转换为基于MySQL结果的超链接,如下所示:

<td><a href="index.php?result=[mysql result]">[mysql result]</a></td>

这是我写的用来初始化DataTables表的代码:

<script>
    $(document).ready(function() {
        $('#example').DataTable( {
            "processing": true,
            "serverSide": true,
            "ajax": "includes/pull_2.php",
            "columnsDefs": [
                {
                    "targets": 0,
                    "render": function (data, type, full, meta) {
                        return "<a href=index.php?result=" + full[0] + ">" + full[0] +"</a>"; 
                    }
                }
            ]
        });
    });
</script>

然而,尽管表的呈现没有任何错误,但它并没有像我期望的那样使第一列成为超链接。有人知道为什么它没有像预期的那样运行吗?

这是我正在测试的表:http://clients.serallo.co.uk/formtest/

参数不是 columnnsdefs ,它是columnDefs只要改变它将工作