Filter Datatable from Dashboard
Filter Datatable from Dashboard
ctechuk
Posts: 12Questions: 5Answers: 0
Evening all,
I am trying to build some stats on my dashboard and would like to be able to add links that will take me to specific data results.
For example, showing how many products are showing active. Clicking that link will take me to the products page already loaded with data filtered by all those products active.
What would be the best practice to achieve this? Any examples would be greatly appreciated.
Many thanks in advance for any help.
Ctech UK
This discussion has been closed.
Answers
Here are a couple options I can think of:
1.You could use the
ajax.data
option to pass the filter to the server script and let it use the filter for the DB query.2. If the Datatable is already laded with all the data then use
search()
to filter the Datatables display.Kevin
Kevin,
thanks for your advice. I resolved it by adding a simple piece of logic in my js
It is not elegant, however is solves my issue for now unless i need to change anything in the associated fetch files which will need to be changed in triplicate.
I will look for a more elegant solution when I have time.
Thanks again.
Ctech.