Additional Method (?) needed to access rows()

Additional Method (?) needed to access rows()

JLH999JLH999 Posts: 13Questions: 3Answers: 0

Hello -

I've learned / used DataTables over the years through copy / paste / modify of examples ... I suppose I have a mix of the "old" and the "new"...

The current version in use: $.fn.dataTable.version ... = 1.10.23

When I define a variable associated to the .dataTable()
theTableTc = $('#datatables-tc').dataTable({

And then attempt to access row information using (below) I receive the error: Object doesn't support property or method 'rows'
var rowCount = theTableTc.rows( { selected: true } ).count();

However, If I insert an additional .DataTable() before .rows() I get the result expected
var rowCount = theTableTc.DataTable().rows( { selected: true } ).count();

My DataTable definition does contain the following:
"select": { style: 'single', selector: 'td:first-child' },

Any thoughts? Am I using DataTables incorrectly?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954
    Answer ✓

    See this FAQ and the linked doc in the FAQ for answers to your questions. Let us know if you need clarification.

    Kevin

  • JLH999JLH999 Posts: 13Questions: 3Answers: 0

    Wow! Thank you !!

This discussion has been closed.