Garrett
Garrett

Reputation: 11725

Using Backbone.Collection for a Paginated List?

I'm wondering if I should be using a Backbone.Collection called ExerciseList for my exercises page, which displays Exercises filtered by various properties. Each Exercise is rendered with an ExerciseRowView. So, would an ExerciseList and ExerciseListView be feasible/useful in this sort of situation?

Thanks!

Upvotes: 2

Views: 8630

Answers (1)

Matthew Lehner
Matthew Lehner

Reputation: 4027

That would work just fine, you're definitely headed in the right direction. You'll have to create a pagination method on the collection.

Here's a great pagination component: https://github.com/addyosmani/backbone.paginator

Have a look at Addy Osmani's (the plugin author) article on Backbone pagination here: http://addyosmani.com/blog/backbone-paginator-new-pagination-components-for-backbone-js/

Should get you the rest of the way there.

Upvotes: 6

Related Questions