I'm currently trying to make a view, which contains images that people can insert into the body of their posts, work with the ajax pagination from the views module, but the tricky part is: the view itself is loaded in using ajax.
The Images view is loaded using jQuery's .load function, and is situated on a page (i.e. /image-gallery-view), but the .load function passes a parameter that just returns the bare content/html without styles or scripts for the purposes of AJAX. When you load this page in your browser, with styles and scripts included, pagination works perfectly.
I have replicated all the jQuery.extend behaviors that this page has in it's head section, and also all the scripts it calls, but the pagination still doesn't work, and the JS console throws no errors.
So in summary:
- Replicated all possible JS files and behaviors from the page where it works.
- Re-instantited/applied behaviors using
Drupal.attachBehaviors(document):
I just don't have a clue. Anyone have any ideas? i need a fresh perspective.
Comments
I encounter the same issue
I encountered the same issue, where I loaded views with ajax, these views contain ajax pagers.
I'm using drupal 7 with the latest views 3.
I fixed the issue by adding the javascript as drupal compiled it, with the view I loaded using ajax I combined the html output of the view and the js from drupal. this way everytime a view got added with ajax it also added the needed js to make sure the pager would work aswell
sample of my code:
The first function will call the view for example:
the second function will add the needed javascript that will be included by ajax to the active page.
Thank you!
Best answer , was looking for this problem solution, tried a lot of patch for view but nothing. Thanks again! :)
Your welcome, even after 2
Your welcome, even after 2 years :P