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.
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.
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.
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.
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!