Filter datatable from a field or a dropdown outside the table
Filter datatable from a field or a dropdown outside the table
enter47
Posts: 2Questions: 1Answers: 0
I have a dropdown <select> Year which is outside the data table and on selecting a particular Year need the data filter to fetch data for only that year? how can I do it? Any help appreciated.
Eg: like the image below.
Answers
Assuming you are using
ajax
you can useajax.data
as a function to get the value of the selected option. Useajax.reload()
in the select change event to refresh the data via ajax.Kevin
Thanks Kthorngren for the quick reply. However, it went above my head as I am new to this. Is there a working model anywhere?
This example here should help - it's demonstrating how to add a variable that gets sent back to the server.
Colin