The frontend shows the right value in the select, but the query is not applied.
I would like to know how to apply the default value in order to apply this to the query's result.
Thank you.
This is because the AJAX being used for our filter is expecting a click event. I was trying to see if I could simulate this click event but its actually beyond me.
So is it that you want to have this query pre-applied? Will this always be the pre-applied query ?
Because what we can do is to overwrite the default view query to display your items based on this predefined query and use conditionals so that the date filter still works.
Hello and thank you,
The "6 months" selection should be pre-applied in deed, but only at initial loading. When the user changes this filter, it's the value he inputs that must apply.
I can resolve this for you however we would need to have the query parameters in the URL for this to work.
What I intend to do is to use the views query filter hook to set the default value. This would mean that the page will be loaded with the default value you want.
Then once the filter is applied then the page will update with the new items. Is this ok with you so I can enable the browser history management to have the urls parameters being displayed ?
Alternative to this we can use the jQuery as you have it but then submit the form so the page results will be loaded when the page finish loads.
Please let me know which of the solutions you think you would want to go forward with.
Hello,
I'd rather keep the parameters hidden. Alternative to this we can use the jQuery as you have it but then submit the form so the page results will be loaded when the page finish loads.
Would this mean the results would be loaded twice ?
Thank you.
Actually yes, this would mean the page search is going to be loaded twice.
The reason is because in order for us to click the submit button on the form we would need to wait until the page is finish loading and the search has loaded to perform a search with the selected value.
Some compromise would need to be made here in order to get some middle ground.