Reset DOM on initComplete
Reset DOM on initComplete
I implemented the alphabetSearch feature across my site (www.txfannin.org). I have a small problem I hope someone can address.
It may be that the results of the query request for the table load produces less rows that the initial value of the lengthMenu array. On the initComplete I check the number of rows (table.rows().data().length) against a fixed value. If less than the value I hide the dataTables_paginate, filter, info, and length divs. Additionally, I would like to hide the alphabetSearch area but this does not have a defined id. The only way I can think to do what I want is to remove the 'A' for the Dom. How to do this?
Further, how can I compare the table.rows().data().length against the initial lengthMenu value, or even the current lengthMenu value?
TIA for your assistance
jdadwilson
Replies
I would suggest the best way might be to simply add an id to the alphabet search's
div
.Use
page.info()
to get paging information.Allan
Allan -- thanks for your response. Adding the div did the trick. Using the page.info() helps with the second but does not totally answer my question. I would like to use something like this... if ( table.page.info().recordsTotal < num ) where num is the initial value of the lengthMenu or better the active value of the lengthMenu.
Thanks for a great product and support
jdadwilson
I'm afraid I don't quite understand why it doesn't resolve it - would you not use:
I assume your question is how to get
num
, in which case thelength
property should do it.Allan