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

  • SEARCH
  • Home
  • 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 8142687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:53:43+00:00 2026-06-06T12:53:43+00:00

I have an app with a calendar page. On that page I have elements

  • 0

I have an app with a calendar page. On that page I have elements that represent appointments. Here’s how I’ve been going about displaying the appointments up until now:

  1. Print all elements onto the page, each one with position: absolute.
  2. Iterate over the elements, taking each element’s appointment_id and setting that element’s top attribute based on how late in the day that appointment starts.

In other words, I dump all the appointments on top of each other at top: 0, left: 0, then I move each appointment vertically to the correct position. (It’s a multi-person schedule calendar, not a regular wall calendar.) I do something similar to arrange the appointments into columns, but that’s not important right now.

Here’s my problem: on the initial page load, everything works fine because every appointment element has an id associated with it. When I update an appointment, though, its ID gets wiped out and that appointment gets missed when I do my rearranging. It just sticks in the upper left.

The reason this is happening is clear and makes sense. I just don’t know what to do about it. In Backbone, how can I refer to an element if I can’t use its model’s ID?

To make things more complicated, none of this rearrangement works at all unless I do it after the view is rendered – in other words, I have to do the rearrangement in the router. This seems wrong, and in the scope of the router, I no longer have access to the individual elements. I only have access to the collection that contains the appointment models, and I can only match each model to its element if its element knows its own appointment ID which, after updating, it doesn’t!

Hopefully that all makes sense. Any suggestions?

  • 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-06-06T12:53:45+00:00Added an answer on June 6, 2026 at 12:53 pm

    Each DOM element that represents an appointment should be a separate view that has an Appointment model bound.

    When Appointment model changes, all you need to do is to re-render that single view (recalculating only one position and making less DOM operations).

    AppointmentView:

    AppointmentView = Backbone.View.extend
        # model: Appointment
        tagName: "div"
        events: {}
    
        initialize: ->
            @model.on 'change:time', @render, @
    
        render: ->
            # calculate the position and append to the DOM
            # you can take a look at setElement function, if needed - http://documentcloud.github.com/backbone/#View-setElement
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that queries the google calendar instances and events API in
Right so I have a simple app that consists of a calendar a Set
I have a web-app that is a sort of calendar application and there are
I have an Android Mobile App that is really just a calendar & you
I have an app that programmatically adds reminders to your iOS device's calendar. Previous
I have a asp.net web app. In my master page I have a calendar
In the iPhone calendar app if you have 2 tiles overlaying ontop of each
I am building an Day View calendar app. I have already created the empty
My app draws a calendar. I have an ivar, _cal, set to -[NSCalendar autoupdatingCurrentCalendar]
I have figured out how to add a custom calendar within my iPhone app,

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.