Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Is there a chance that Views Infinitiv Scroll will work with ajax enabled views in the near future?
It would be a real killer feature!
Thanks a lot!
Comment | File | Size | Author |
---|---|---|---|
#36 | ajax_compatibility-1335792-36.patch | 14.38 KB | Anonymous (not verified) |
#29 | views_infinite_scroll.zip | 17.37 KB | nishant_k |
#28 | ajax_compatibility-1335792-28.patch | 10.22 KB | Sam152 |
#27 | ajax_compatibility-1335792-27.patch | 10.16 KB | Sam152 |
#26 | ajax_compatibility-1335792-26.patch | 10.2 KB | Anonymous (not verified) |
Comments
Comment #1
Remon CreditAttribution: Remon commentedComment #2
Stolinski CreditAttribution: Stolinski commented+1 This feature is essential.
Comment #3
DerekL CreditAttribution: DerekL commented+1
I would be great to not have to pick between exposed forms and infinite scroll.
Comment #4
xopoc CreditAttribution: xopoc commented+1
Comment #5
kbeck303 CreditAttribution: kbeck303 commentedI'm also looking for a solution for infinite scrolling and ajaxed better exposed filters. It's a bummer you can't have views Ajax enabled while infinite scrolling is turned on.
Comment #6
kbeck303 CreditAttribution: kbeck303 commentedI found a different solution for having views Ajax enabled (for ajax filters) and using an infinite scroll option.
I used Views Load More module (NOTE: you have to use the DEV version, which has the Waypoints module integration otherwise the infinite scroll doesn't work.)
- http://drupal.org/project/views_load_more
- http://drupal.org/project/waypoints
Comment #7
doliveros CreditAttribution: doliveros commentedDamn! Spent a whole day hacking my way through views infinite scroll just to make it work with an ajaxified faceted view. Oh well, it's nice to know there's already a way to accomplish this.
Comment #8
cwithout CreditAttribution: cwithout commentedI have a patch almost ready that makes the module compatible with views ajax (and adds the iphone compatibility mention in #1180962: iPhone compatibility). Both iPhone and AJAX support require additions to the Autopager plugin, which I added here https://github.com/cristinawithout/jquery-autopager-too.
Before I submit the patch, I have a question for the maintainer(s). Would you prefer that I have the module check for the existence of the newer version of the plugin and fall back to the old. (Which will require more file_exists() checks and a setting value passed to JS to determine if the site is running a version compatible with ajax or not.) Or would you prefer I change the module to *just* support the newer version and add an update hook with a message like "You must update to the jQuery Autopager Too plugin. Download and place this file into sites/all/libraries/autopager or download it using drush dl-autopager."
The latter option (supporting only 1 version) keeps the code cleaner, and is what I would prefer, but I don't want to be too presumptuous in changing the module's supported plugin.
Comment #9
cwithout CreditAttribution: cwithout commentedSo I don't leave this half finished and have to figure out later where it left off, I just finished up the patch requiring the new plugin. I can revisit it later if maintainer(s) would prefer to have the fallback code.
Please test for views ajax compatibility. Instructions for updating the jquery plugin are contained within the patch and can be found from the update.php or status report (admin/reports/status) pages.
Comment #10
cwithout CreditAttribution: cwithout commentedUpdating status.
Comment #11
paveq CreditAttribution: paveq commentedThis patch seems to work fine.
Comment #12
funkDoc CreditAttribution: funkDoc commentedThanks for this patch, works great with ajax now for me. Also fixed the loading in iphones, I think from the updated jquery script.
Comment #13
kietnguyen CreditAttribution: kietnguyen commentedThe patch on #9 works great. Thank you.
Comment #14
aabdullahh CreditAttribution: aabdullahh commentedthanks... I don't use drush
can you provide me with a simple patch
with regards
Comment #15
cwithout CreditAttribution: cwithout commented@aabdullahh The patch is in #9. You don't need to use Drush to use the patch, but the patch does address the module's existing Drush integration.
Comment #16
ryan.gibson CreditAttribution: ryan.gibson commentedApologies if this is unrelated, should be addressed after the patch is committed, or isn't related to a problem in this module/patch.
The patch applied cleanly and ajax can now be enabled.
If you take a look at my site -> Development Site and at the right sidebar. You'll see that I've got a view that scrolls that has a Disqus comment count field. The comment counts work on the initial load, but when scrolling and loading more, it doesn't work, only "comments" appear. I thought ajax would do the trick, but it is still a no go.
Again, if this isn't something the ajax is meant to fix then please place this back to RTBC.
Comment #17
lavamind CreditAttribution: lavamind commentedIs this patch supposed to work when using exposed filters? I've tried it and the form disappears after submitting...Sorry, the patch works fine with exposed filters, my CSS was just in the way!!
Comment #18
DenEwout CreditAttribution: DenEwout commentedI applied the patch but I'm still having some problems when using exposed filters (using Better Exposed Filters and default exposed filters) and ajax enabled.
When changing the filter options, the view changes correctly but the infinite scroll doesn't work anymore. (export of my view)
Comment #19
drupalina CreditAttribution: drupalina commentedIs the patch in#9 included in the latest dev?
I applied the patch manually (line by line). Uninstalled it, then reinstalled it. And now all I get is a simple pager:
1 of 3››
although inside my View settings it says "Infinite scroll"
Comment #20
Fulgrim CreditAttribution: Fulgrim commentedsorry #9 does not work for me
Comment #21
loganphp CreditAttribution: loganphp commented#6 works for me.
I am using following modules together.
- http://drupal.org/project/views_load_more
- http://drupal.org/project/waypoints
- https://drupal.org/project/search_api_ajax
It combination works good.
Comment #22
ransomweaver CreditAttribution: ransomweaver commentedHere's a different approach that may appeal so some in fixing this problem, and would be an easy integration for the maintainers.
I have infinite scroll views that are updated via ajax using the nodejs_views module. Its not a requirement that these views be set to ajax in views. Mine aren't. I had the same problem that after the ajax reload, it shows the pager and the infinite scroll js doesn't run.
My solution is to use the livequery plugin: https://github.com/hazzik/livequery/
in views_infinite_scroll.js the infinite scroll is initialized like this:
With the livequery plugin its a one-liner to change it so that it will re-initialize when the DOM is updated:
I haven't tested with regular ajax views.You'd just have to remove the code that checks if its ajax.
Comment #23
scapegoat17 CreditAttribution: scapegoat17 commentedI do not believe this patch is working with exposed filters. On page load, it seems to be loading the pages correctly every single time. When I do an exposed filter search, this no longer works when scrolled to the bottom. It seems that the scroll event is not even attached anymore and the attach function is no longer there.
Has anyone found a solution for this?
Comment #24
Sam152 CreditAttribution: Sam152 commentedI have a working patch for this issue which also includes the patch from #1316194, to allow you to load more content with a button. It's still in early stages and there are a few things that could stand to be cleaned up on the JS side of things, but it's a working solution for my immediate requirements.
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedRe-rolled patch against git code so it doesn't break on the .info file.
Comment #26
Anonymous (not verified) CreditAttribution: Anonymous commentedFixed bad manual patch errors with js file.
Comment #27
Sam152 CreditAttribution: Sam152 commentedAttached another reroll of the above to fix some whitespace errors and remove a stray console.log.
Comment #28
Sam152 CreditAttribution: Sam152 commentedAnother bug fix related to where the content is loaded.
Comment #29
nishant_k CreditAttribution: nishant_k commentedIts views infinite scroll module which is compatible with views ajax feature. All the work is done by cwithout and Sam152. I just compiled it. And its working for me.
Comment #30
jienckebd CreditAttribution: jienckebd commented#29 works -- also comes with the required library.
Comment #32
Sam152 CreditAttribution: Sam152 commentedThis fix has been fixed in the last dev release and will likely be tagged in a stable release over the next few weeks.
Comment #34
kopeboy CreditAttribution: kopeboy commentedCan you include this in a stable release?
Comment #35
Anonymous (not verified) CreditAttribution: Anonymous commentedI believe I have the stable release of views infinite scroll (Views Infinite Scroll 7.x-1.1) and still have the warning "Views infinite scroll pager is not compatible with Ajax Views. Please disable "Use Ajax" option" So I guess this is not yet in stable.
I'll install dev though.
Comment #36
Anonymous (not verified) CreditAttribution: Anonymous commentedThe autopager library is still missing and needed to be added manually from the dev version.
I added another patch file for version 1.1, created from #29 zip file - so it can be added in project.make file.
Comment #37
edutrul CreditAttribution: edutrul commentedSusbcribe!
Comment #38
deepakrmali CreditAttribution: deepakrmali commentedSubscribe...
Comment #39
miccelito CreditAttribution: miccelito commentedAbove patch #29 is solving the ajax issue with Views exposed filters only. Is that right?
There might be more cases beside exposed filters when ajax functionality is needed for a views display i.e. Drupal Commerce product list page where "Add to cart" buttons are ajaxfied, but wont work if Views Infinite Scroll is enabled. Well, just to say. But I guess Views exposed filters was prio issue for Infinite Scroll..
Comment #40
miccelito CreditAttribution: miccelito commentedThese may be related:
AJAX do not work with Quicktabs module https://www.drupal.org/node/2185999
ajax cart not working for several product views in a page https://www.drupal.org/node/2357855
I.e. Quicktabs may have similar issue as Views Infinite Scroll with ajax content.
Mentioned there may other ajax elements than just Exposed filters, i.e. "add to cart" forms.
Normally those forms would have the action="/" and the input (type="submit") would have the extra class 'ajax-processed' when Views ajax is enabled.
But when scrolling down with Views Infinite Scroll this doesn't happen but instead form action="/***?page=1" etc and doesn't add the class 'ajax-processed' to input tag.
Does anyone have a clue how to solve this? Maybe can be solved in the 'views_infinite.js' file? Somewhere at line 4..
Comment #42
Honza Pobořil CreditAttribution: Honza Pobořil as a volunteer commented