0

I have a List view and a Detail view.

In list view, I have set up the jquery infinite-scroll plugin.

When a user clicks an item, I render the detail view. The problem is when the user hits bottom of the page, the infinite-scroll callback is fired.

I tried calling $.infinitescroll('pause') but it won't stop the fetch.

Should I completetly destroy the list view before rendering the detail view?
If so, how can I completely destory it? (I tried https://stackoverflow.com/a/11534056/433570 but didn't stop the infinite-scroll callback)

My code resembles https://github.com/joshbohde/django-backbone-example in a big picture

Community
  • 1
  • 1
eugene
  • 39,839
  • 68
  • 255
  • 489
  • You should look at http://stackoverflow.com/questions/12359604/unbind-backbone-view-events – automaticAllDramatic Apr 24 '14 at 10:50
  • Yes, destroy the view when you're done with it. No need for a new method, just override [`remove`](http://backbonejs.org/#View-remove) to include your infinite scroll unbinding and chain to the base `remove`. – mu is too short Apr 24 '14 at 17:02

1 Answers1

0

Have you tried doing event.stopPropagation on the scroll event inside the Detail view?

Roman
  • 13,100
  • 2
  • 47
  • 63