-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not triggered with page scroll #21
Comments
Sorry for the disturbance. I found the error. It was a false intendation |
@deha23 I am running into a similar problem and cannot figure out a solution. The manual commands work, but page scrolling will not trigger an ajax call. I do not have Turbolinks and here is my setup: <!-- _user.html.erb -->
<% @users.each_slice(2) do |user_row| %>
<div class="row">
<% user_row.each do |user| %>
<div class="col-xs-12 col-md-6">
<!-- partial for user card -->
<%= render partial: 'users/users_search_results', locals: {user: user} %>
</div>
<% end %>
</div>
<% end %> <!-- index.html.erb -->
<div class="infinite-scrolling">
<div class="user-search-results">
<%= render :partial => 'users', :object => @users %>
</div>
<p class="pagination text-center">
<%= link_to_next_page(@users, 'Next Page', :remote => true) %>
</p>
</div> <!-- index.js.erb -->
// Append new data
$("<%=j render(:partial => 'users', :object => @users) %>")
.appendTo($(".user-search-results"));
// Update pagination link
<% if @users.last_page? %>
$('.pagination').html("That's all, folks!");
<% else %>
$('.pagination')
.html("<%=j link_to_next_page(@users, 'Next Page', :remote => true) %>");
<% end %> # infinitScrolling.js.coffee
$ ->
# Configure infinite table
$('.infinite-scrolling').infinitePages
# debug: true
loading: ->
$(this).text('Loading next page...')
error: ->
$(this).button('There was an error, please try again') Again, submitting the following commands in the developer's console: $('.infinite-scrolling').infinitePages('next')
$('.infinite-scrolling').infinitePages('pause')
$('.infinite-scrolling').infinitePages('resume') works perfectly fine, but scrolling will not activate the ajax call, debugging messages, or even the loading text. |
I couldn't get it to work so I ended up following this tutorial using a different plugin: |
I am able to trigger the infinite scroll manually with "$('.infinite-table').infinitePages('next')"
but nothing happens when I am scrolling. Any Ideas?
Thanks in advance
The text was updated successfully, but these errors were encountered: