Quantcast
Channel: Question and Answer » views-contextual-filters
Viewing all articles
Browse latest Browse all 57

ajax get to refresh a view with contextual filters

$
0
0

A view (path example : foo/201507/video) has two contextual filters, the first for the month (YYYYMM) and the second for a taxonomy term (with depth).

The interface provides next and previous buttons for the month and an accordion to select a taxonomy term in the hierarchy.

After each click on a month button or on an accordion entry, the filter criteria have changed and the view’s results need to be updated : the associated JavaScript builds the new URL in the path variable, then

var ajax_get = $.get( path)
          .done(function() { alert( "Ok" ); })
          .fail(function() { alert( "Error" ); });

The path is correctly built. I get the “Ok” alert, but nothing else happens. Moreover, if I enter the path manually in the URL bar of the browser, the view displays the expected results.

Has is to do with the fact that I bypassed primary and secondary navigation to directly add Bootstrap buttons and collapse into the page.tpl.php template file ?


Viewing all articles
Browse latest Browse all 57

Trending Articles