Column Pre-Filtering with Select Dropdowns

Column Pre-Filtering with Select Dropdowns

redroosterdesignredroosterdesign Posts: 19Questions: 3Answers: 0

Is it possible to pre-filter a dataTable based on the selection of a select dropdown list? I know that you can do this with search terms, but I have not found an example of this being done with a select dropdown list. I would like to be able to type in a URL similar to www.URL.com/?search= but instead with the select dropdown pre-filtered.

Replies

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    type in a URL similar to www.URL.com/?search=

    There is the deep linking plugin to do this.

    but instead with the select dropdown pre-filtered.

    Datatables doesn't provide a select dropdown element. This is something you have created. You can use something like URLSearchParams to look for the select search parameter. The use something like jQuery val() to set the select option and jQuery trigger() to trigger the select option.

    Kevin

Sign In or Register to comment.