I want to use a form above my data table to query a prepopulated JSON file.
I want to use a form above my data table to query a prepopulated JSON file.
Hi All -
I am very new to this.
I have two files
mysite/table.html
mysite/data.JSON
table.html is currently loading all values from data.JSON and putting them into a data table.
I have input boxes and drop down menus above the data table that are not currently "connected".
My goal is to be able to choose a value from a dropdown box, click search, and only return values into the table that match in the JSON.
I was looking for examples on datatables.net but I am not exactly sure what this is called. Could someone point me in the right direction?
Thanks so much.
This question has an accepted answers - jump to answer
Answers
Use the
search()
method to search the table for the string you want. Orcolumn().search()
if that data is in a single column.Trigger your search from a
change
event on theselect
element.Allan
Thank you, allan. This worked!!!
One follow up question will coming in a new post.
I marked this post as answered/resolved.
Thanks again.