columns.name & column selector not working

columns.name & column selector not working

veendzveendz Posts: 1Questions: 1Answers: 0

Hello, I was just trying the new DataTables 1.10. I tried to use name as index instead of integer index so that I can use column(string:name) as column selector.
Here is my code:

var oTable;
$(document).ready(function() {
    oTable = $('#example').DataTable({
        'columns' : [
            {'name' : 'name'},
            {'name' : 'position'}
        ]
    });
} );

I just followed the example but I kept getting this error: "Uncaught TypeError: Cannot read property 'mData' of undefined ".
When I changed "columns" to "column", I got no more error but I can't use oTable.column('position:name').data() as column selector. Please help!

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Can you link to a test page showing the issue please? Do you only have two columns in the table?

    Allan

This discussion has been closed.