I am having trouble following API documentation.

I am having trouble following API documentation.

kvn9328kvn9328 Posts: 18Questions: 7Answers: 0
edited November 2014 in Free community support

Hi,

I am trying to find the number of rows my datatable contains.

@allan,

oTable.fnSettings().fnRecordsTotal() should do it.
oTable.fnSettings().fnRecordsDisplay() will give you the number after filtering has occurred.

This is what i found in the forum discussions. But i just want to check the location where i can see all the methods/functions that i can use on datatable API.

And, i am using latest release of datatable API and i am using this to get the number of rows:

table = $("#pagination").DataTable();

var data = table.fnSettings().fnRecordsTotal();

But still no luck.

@Allan,

Could you please let me know, how i could get row count for datatables? And please provide me the links where i can access proper documentation for all the API methods.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,950Questions: 1Answers: 10,158 Site admin

    the number of rows my datatable contains.

    Use page.info(). It is a public API (unlike the other ones you mention which are private and shouldn't be used) and has the information you request.

    Allan

  • allanallan Posts: 61,950Questions: 1Answers: 10,158 Site admin
    Answer ✓

    Missed this:

    But i just want to check the location where i can see all the methods/functions that i can use on datatable API.

    Click "Reference" and then "Api" in the site navigation on the left :-).

    Allan

This discussion has been closed.