How to get number of rows (Editor)?

How to get number of rows (Editor)?

adrianriepl4adrianriepl4 Posts: 11Questions: 4Answers: 0

Hey guys,

I wanted to get the total of entries of the table throught editor. But I can't get it worked. I already tried this (http://datatables.net/forums/discussion/20429/determine-number-of-rows-in-table) , but somehow this function is undefined.

How can I get the total of entries in Editor?

Thanks for your help!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Answer ✓

    The rows exist in DataTables, so surely you would get the number of rows from DataTables? The method for that is page.info().

    Allan

  • adrianriepl4adrianriepl4 Posts: 11Questions: 4Answers: 0
    edited March 2015

    Thanks, I'm sure thats it :)

    But even though all rows appear, I still get 0 total through page.info() ?

    But when I call it via the console it shows me the correct number.

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    Are you loading data via Ajax and then immediately calling page.info()? If so, recall what the first a in Ajax stands for :-). You need to use initComplete to wait until the data has been loaded.

    Allan

  • adrianriepl4adrianriepl4 Posts: 11Questions: 4Answers: 0

    Ahh you're right. Totally forgot about that. Thanks now it works like charm! :) Great support!

This discussion has been closed.