Skip Navigation

[Resolved] Update Two Views from One Search Filter

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by jesseB-4 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#918450

Hello, I have two Views that make up a kitchen display screen on my client's website. One is named "Kitchen Orders" and the other "Kitchen Orders All Modals". The former displays all the orders and the latter displays a single order in a modal. The modal view contains custom AJAX inputs to change the order's status. When an order's status is changed, the entire KDS is updated via "Kitchen Orders" view's search filter.

Is it possible to have both views updated by the search filter? Right now the Kitchen Orders view gets updated but the modal view does not. For example: If I change an order's status from Processing to Packaged and the KDS updates, the modal of the same order still say it is Processed, not Packaged.

I think before, both views get updated because we were trying to use CRED forms in the modal view, but they didn't work out.

Also, please see this similar topic: https://toolset.com/forums/topic/multiple-views-updated-from-single-parametric-search/
Based on Nigel's comments, does this mean we cannot have both updated using AJAX, but only page reload? I'd prefer to keep the KDS from reloading if possible.

Any advise on this would be appreciated.

#918489

You can't directly update two AJAX Views with one set of filter controls. With a full page refresh, it's possible because both Views can respond to the same URL params. Upon submission of View 1, you would have to figure out a way to apply the filters from View #1 into the same filters for View #2, then trigger an update of View #2.

#918512

Hi Christian,

Please see this quote from the aforementioned topic:

"Views uses url parameters to track information such as pagination or search terms, and that when there are multiple views on a page that use the same parameters they don't know which view the parameters "belong to" and will respond to any parameters that match those used in the view.

So if you create two views with the same characteristics (the search filters etc.) and the only difference is in the Loop Output then both views will update when the page refreshes (again, this won't work with ajax, you will need a page refresh to trigger an update of the second view)."

So I should re-create the Modals view as a custom search view with the same parametric search as the Kitchen Orders view, but I would still need to use page reload?

I just want to confirm this before we do any editing. If AJAX won't work we will return to using page reloads.

#918854

So I should re-create the Modals view as a custom search view with the same parametric search as the Kitchen Orders view, but I would still need to use page reload?
Any Query Filters shared by these two Views should be configured identically in both Views. That means they should use the same URL parameters, comparison criteria, and so forth. View #2 doesn't necessarily need actual filter controls in the Search and Pagination editor, just the same shared Query Filters. Whether or not you need to recreate the Modals View or just modify the existing one is up to you, but l would duplicate it and work from the duplicate so you have a backup.

In the example explained by Nigel, you still need to use page reload. Otherwise View #2 will not respond to the updated filters from View #1.

#918960

That's unfortunate to hear. Okay, we will try and continue using the AJAX update wherever we can, add the custom AJAX status update outside of the modal, and set up a refresh interval as well.

Thank you once again Christian for the superb support. You have a good one!