Filter datatable from a field or a dropdown outside the table

Filter datatable from a field or a dropdown outside the table

enter47enter47 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

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Assuming you are using ajax you can use ajax.data as a function to get the value of the selected option. Use ajax.reload() in the select change event to refresh the data via ajax.

    Kevin

  • enter47enter47 Posts: 2Questions: 1Answers: 0

    Thanks Kthorngren for the quick reply. However, it went above my head as I am new to this. Is there a working model anywhere?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This example here should help - it's demonstrating how to add a variable that gets sent back to the server.

    Colin

Sign In or Register to comment.