Uncaught TypeError: Cannot read property 'aDataSort' of undefined

Uncaught TypeError: Cannot read property 'aDataSort' of undefined

orionixorionix Posts: 1Questions: 0Answers: 0

Hi all!

Hope, it may help someone else.

I had several tough hours trying to sort this issue out. And yes, it only happened due to inattention.
So I caught that painful error having pretty simply example:

<head>
<script>
    $( document ).ready( function() {

        $( '#users_table' ).DataTable( {
            "order": [[ 5, "asc" ]],
            "lengthMenu": [5, 10, 20]
        });

    });
</script>
</head>

<body>
<table class="display dataTable" id="users_table"> 
    <thead> 
        <tr> 
            <th>User Id</th>
            <th>User Name</th>
            <th>User1</th>
            <th>User2</th>
            <th>User3</th>
        </tr> 
    </thead>
    <tbody>
        <c:forEach items="${users}" var="users"> 
            <tr>                        
                <td id="${users.userId}">${users.userId}</td>
                <td>${users.userName}</td>
                <td>1</td>
                <td>2</td>
                <td>3</td>
            </tr>
        </c:forEach> 
    </tbody> 
</table>        
</body>

And the answer is pretty simple and had to be obvious. I was stuck dumb.
The value of 'order' property is obviously incorrect, having fixed it everything works great!

This discussion has been closed.