How to show data only if I do a search or use Yadcf filter?
How to show data only if I do a search or use Yadcf filter?
lenamtl
Posts: 265Questions: 65Answers: 1
I'm using a request that populate a table but what I need is to set the table to show no info (empty result) on load .
What I need is to display the info if I do a search or use a Yadcf filter.
Is there a way to set Yadcf and/or Datatable for that?
I'm not using the server side processing.
Any suggestion is welcome
Thanks
This discussion has been closed.
Answers
I haven't tried this but what I would try is using the search api and if the
.val()
of your search input is blank or length 0 then returnfalse
otherwise returntrue
. This will be called when the table is drawn.I'm thinking that anytime the search field is blank it will show a table with no matching records. Then as you type into the search input the table will display the normal search results.
Kevin