angular-datatables`无法读取属性' aDataSort'未定义的

时间:2015-06-09 13:19:44

标签: javascript angularjs datatables undefined jquery-datatables

请帮忙。我无法让服务器端datatable正常工作。

当我将.withOption('ajax', ...)添加到选项时,它无法再加载。我收到错误:Cannot read property 'aDataSort' of undefined

这是我的HTML:

<table id="myTable" datatable class="table table-striped" dt-options="options" width="100%">
<thead>
    <tr>
        <th>Col1</th>
        <th>Col2</th>
        <th><!--Col3--></th>
        <th><!--Col4--></th>
        <th>Col5</th>
        <th>Col6</th>
        <th>Col7</th>
        <th>Col8</th>
        <th>Col9</th>
    </tr>
</thead>

这是我控制器中的JS:

$scope.options = DTOptionsBuilder.newOptions()
                .withOption('ajax', {
                    url: '/api/all',
                    processing: true,
                    type: 'POST',
                    dataSrc: 'data'
                })
                .withOption('processing', true)
                .withOption('serverSide', true)
                .withBootstrap()
                .withLanguageSource('lib/datatables/lang/Dutch.json')
                .withOption('searching', false);

编辑 - 同样重要的是要知道没有对数据进行AJAX调用。

有人可以告诉我发生了什么吗?

0 个答案:

没有答案