Connecting data table with dependent dropdowns

By: Jan Petri | Asked: 03/08/2023
ForumsCategory: How-toConnecting data table with dependent dropdowns
Jan Petri asked 1 year ago
I have a data table of trailers that we sell.  Separately, I have created a search form that has three dependent dropdowns to help narrow down searches.  I have also created a view for the datatable that has the dependent dropdown in the "Before Content" box.  In the The dependent dropdown itself works, but it doesn't have any filtering effect on the data table below, meaning that results down get narrowed down, I only get the full inventory listing. 
5 Answers
Best Answer
Bobby Clapp answered 1 year ago
On submit has been removed in favor of a new "Confirmation" action over in "Actions & Notifications" settings in the latest version.
Bobby Clapp answered 1 year ago
Please describe the implementation of your dropdown in the "before content" box and what you are expecting it to do. Why can't it be in the search form?
Jan Petri answered 1 year ago
Thank you for taking the time to look at this.  I set it up this way based on following instructional videos from FF (https://youtu.be/QVxcGqdoC7A).  I have created an inventory list of trailers that we sell.  I want to post this on my website so that customers can filter this list down to the type of trailer that they are looking for.  To do that I have three dropdowns (https://trailersalesadvisors.com/frm_display/mar-6-searchable-view/) that are based on lookup fields.  These dropdowns are in a separate form.  The first dropdown looks up the type of trailer using the inventory list. The second looks up dimensions of the previously selected type and finally, the third lookup selects the GVWR by looking it up from the inventory list and by "watching" the previous two lookups.  I have then combined the inventory list and the search form in a View, specifically a grid view.   The result seems that the lookup dropdowns are working in relation to each other, but those results are not displayed in the view.  There is no connection between the dropdowns and the displayed results in the inventory list.  
Victor Font replied 1 year ago

After someone makes their selections, how are you passing the selected parameters to the grid view so it can filter the results?

The search forms and grid views do not link to each other automatically. Your selection criteria must be passed in a URL as Query string parameters or through an optional shortcode that assigns values to a view just before it runs its query and displays the results on the page. When using Query string parameters, you have to "Submit" the results with a submit button, then redirect the page back to itself with a properly formatted query string so the view can display the search results.

Regardless of whether you use a Query string or shortcode to assign filter values, the grid view needs to run the SQL query on the server that includes the filter parameters established by the cascading drop down. This is a round trip data express to the server. You submit the search criteria, a query string is constructed that passes those parameters to your grid view, your grid view runs the SQL Query with filtered parameters, and returns the results to the browser for display on your page. That's the process. It sounds like you could have missed a step.

Bobby Clapp replied 1 year ago

Have you watched the video on how to create a search? https://www.youtube.com/watch?v=PJFES5URcwg

Jan Petri replied 1 year ago

Bobby, thank you for your help. I have watched that video. I have narrowed down the part of the video that contains the answer to my question and I will do my best to implement it in my solution.

Jan Petri answered 1 year ago
Victor, thank you so much for taking the time to explain this.  I found exactly what you are referring to in one of the tutorial youtube videos.  I will look this over and have another go at this.  I very much appreciate your generosity in sharing your time and expertise. 
Jan Petri answered 1 year ago
So, here is where I am getting hung up.  In the video,  https://www.youtube.com/watch?v=PJFES5URcwg, the "Settings" page has several options under "On Submit" (see Screenshot 1).  When I try to duplicate these settings, I find that I don't have those same options under "On Submit" (see Screenshot 2). What am I missing?
Attachments
Bobby Clapp replied 1 year ago

On submit has been removed in favor of a new "Confirmation" action over in "Actions & Notifications" settings in the latest version.

Jan Petri replied 1 year ago

I figured out where they hid the "On Submit" functionality. It's under Settings/Actions & Notifications/Confirmation.

Jan Petri replied 1 year ago

I figured out where they hid the "On Submit" functionality. It's under Settings/Actions & Notifications/Confirmation.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right