How to deal with empty table after filtering

How to deal with empty table after filtering

PummraPummra Posts: 20Questions: 0Answers: 0
edited June 2011 in General

Is there anyway to call a function when the table is empty after being filtered? Also is there any way to change where the empty table message appears?

Replies

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    For the second part you want http://datatables.net/usage/i18n#oLanguage.sZeroRecords . For the first you could use fnDrawCallback and test to see if there is any data in the table. Specifically if $('td.dataTables_empty').length == 1, then the table is empty.

    Allan
  • PummraPummra Posts: 20Questions: 0Answers: 0
    Brilliant, thanks. Will have a play with that.

    Awesome plug-in btw. If I ever manage to get this project off of the ground (I have been developing it on and off for a few years now) I will ping a donation your way!
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    :-). Good luck with your project - post a link in the forum when you've got it going!

    Allan
This discussion has been closed.