Setup: I have two contextual filters, service area and ID.
In my view if I send {service_area}/{id} i get back the OR query, which is what I want. My question is, when I try to use Jquery to return this query, I do not get back the expected result, which is the OR of these two arguments.
Here is my code:
(function($) {
Drupal.behaviors.searchresults = {
attach: function (context, settings) {
$('.currentFilters', context).once('search').click(function () {
//hard set variable for this example.
let args = [];
args[0] = 'antelope valley';
args[1] = '221';
$.ajax({
url: '/views/ajax',
type: 'post',
data: {
view_name: 'webform_submissions',
view_display_id: 'page_1',
//This is where it may be causing an issue. I pass an array with the arguments, but no avail
view_args: args,
},
...
});
});
},
}
})(jQuery);
In my view I am able to see this OR if I preview with contextual filters as as seen in the image below:
If I just send service_area
by itself as the argument, it will work. So my question is, what is the correct way of sending multiple arguments in ajax, any references/blogs to help me would be appreciated. Thank you!