Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:46:56+00:00 2026-05-24T13:46:56+00:00

I am using Backbone.js to render a list of items e.g Books. After the

  • 0

I am using Backbone.js to render a list of items e.g Books. After the list is rendered, there are options for user to sort them. So if user clicks on Sort By Title, or Sort By Author Name the list will sort itself on the client side.

  window.Book = Backbone.Model.extend({
   defaults: {
     title: "This is the title",
     author: "Name here"
   },

What is the best way to accomplish this sort using in the context of a Backbone application. Do I use a jQuery dom sorter in the AppView?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:46:58+00:00Added an answer on May 24, 2026 at 1:46 pm

    There’s a discussion on this very topic that you might want to look at: https://github.com/documentcloud/backbone/issues/41.

    The short of it is that when a user selects ‘sort by X’, you can:

    1. Set the comparator function on the Collection
    2. Call the Collection’s sort function (which will trigger a sort event)
    3. Listen for the sort event in your View, and (clear and) redraw the items

    Another way to handle steps 1 & 2 is to have your own method that calls the Collection’s sortBy method and then triggers a custom event that your View can listen to.

    But it seems to be the case that clearing and redrawing is the easiest (and maybe even the fastest) way to sort your View’s and keep them in sync with your Collection’s sort order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Backbone.js to render a list of items. THis is working, I have
I'm trying to render a Backbone.js collection as a select list using an Underscore.js
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
New to using Backbone and have a very simple application. Basically there are Clients
Using Backbone I can fetch the Collection like below and render a Backbone View
I'm trying to display a list of projects using backbone.js. Basically, backbone should be
I am using backbone.js (0.5.3) with JQueryMobile (1.0 beta 2). I know there are
I'm using backbone.js and iScroll. As part of the render process I need to
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C#, I need a class called User that has a username, password, active

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.