2

次のようなテーブルがあります。

編集:

<table id="results">
<thead>
    <tr>
        <th>ID</th>
        <th>NAME</th>
        <th>NUMBER</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td><a href="#" onclick="$('#user_1').toggle();">1</a></td>
        <td>JOHN</td>
        <td>311-123-4523</td>
    </tr>
    <tr id="user_1" class="hide">
        <td colspan="3">
        Some information about the user
        </td>
    </tr>
</tbody>    
</table>

<script>
    $(document).ready(function(){
        $('#results').dataTable({
            "sPaginationType": "bootstrap"
        });
    });
</script>

注: ID 番号をクリックすると、詳細行を表示/非表示にできます。

dataTable が colspan を使用してテーブルをレンダリングしようとすると問題が発生します。このエラーが発生します。

Uncaught TypeError: Cannot read property 'asSorting' of undefined 

詳細行を削除すると、データテーブルはすべてを正常にレンダリングします。

上記のように、dataTableに詳細行を無視するように指示できるかどうかを知りたいです。

4

3 に答える 3