Navigation Menu

Skip to content
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

Infinite scroll keeps repeating last records from database #49

Closed
vondwater opened this issue Jun 10, 2011 · 7 comments
Closed

Infinite scroll keeps repeating last records from database #49

vondwater opened this issue Jun 10, 2011 · 7 comments

Comments

@vondwater
Copy link

My infinite scroll keeps repeating the last records from database when on end of amount of pages. Is this a bug or what am I doing wrong?

$('#list').infinitescroll({
navSelector : "div.pagination a#next:last",
nextSelector : "div.pagination a#next:last",
itemSelector : "#list #assortiment",
debug : false,
loadingText : "loading...",
animate : true,
extraScrollPx: 100,
bufferPx : 40,
localMode : true
});

The id #assortiment is a table where the infinite scroll adds the rows to, this works but when I'm out of pages the infinite scroll remembers my last page and keeps scrolling that page.

If I use the triggered infinite scroll all is correct. Seems to be something with the binding of my infinite scroll?

@lukeshumard
Copy link
Contributor

Which version of the plugin are you using? Do you have a live site we can see this on or could you replicate with jsFiddle? Thanks.

@vondwater
Copy link
Author

Hi

I'm using version 2.0 at the moment. I've downloaded it from github. I have
a live website running but it is with a login and confidential, After the
weekend I'll make a testpage so that you can see what's going wrong.

Jurgen

2011/6/10 lukeshumard <
reply@reply.github.com>

Which version of the plugin are you using? Do you have a live site we can
see this on or could you replicate with jsFiddle? Thanks.

Reply to this email directly or view it on GitHub:
#49 (comment)

@vondwater
Copy link
Author

I've made a test page. You can visit it on http://extranet.lunasoftbe.com/ecommerceV3/index.php/nl/login/test
The third time you have a new infinite scroll it are the duplicate values

@lukeshumard
Copy link
Contributor

In my console, I see that it's requesting ?page=2, ?page=3, ?page=4 and so on. Maybe this is something to do with how you're returning results from your query rather than the plugin?

@vondwater
Copy link
Author

My query returns a total of 2 pages, I've printed that out after the first
part of the table. After the second page my query does nothing anymore he
just keeps repeating the last values. Could it be that there is a problem in
the retrieve function of the infinite scroll plugin? I've enabled debug and
it gave me
["heading into ajax", ["/ecommerceV2/index.php/nl/ecommerce/index?page=", ""
]] but where is the page number here?

2011/6/15 lukeshumard <
reply@reply.github.com>

In my console, I see that it's requesting ?page=2, ?page=3, ?page=4 and so
on. Maybe this is something to do with how you're returning results from
your query rather than the plugin?

Reply to this email directly or view it on GitHub:
#49 (comment)

@lukeshumard
Copy link
Contributor

That path in debug is an array split into 2 parts. Where the separation is (?page=) is where your page number goes in. The second value of the array is whatever would come after. Yours is blank, so nothing comes after it.

What comes up in mine is ?page=2, ?page=3, ?page=4 and so on. If I go to http://extranet.lunasoftbe.com/ecommerceV3/index.php/nl/login/test?page=4, it's bringing up the values that you say are repeated. In your backend solution, you just need to sort it so that if there are no more results, it should result in a 404.

@vondwater
Copy link
Author

Thank you for the help. It was indeed the 404 response that I needed.
Everything is working fine now.

2011/6/17 lukeshumard <
reply@reply.github.com>

That path in debug is an array split into 2 parts. Where the separation is
(?page=) is where your page number goes in. The second value of
the array is whatever would come after. Yours is blank, so nothing comes
after it.

What comes up in mine is ?page=2, ?page=3, ?page=4 and so on. If I go to
http://extranet.lunasoftbe.com/ecommerceV3/index.php/nl/login/test?page=4,
it's bringing up the values that you say are repeated. In your backend
solution, you just need to sort it so that if there are no more results, it
should result in a 404.

Reply to this email directly or view it on GitHub:
#49 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants