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 8449695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:46:46+00:00 2026-06-10T10:46:46+00:00

Example: http://franklovecchio-playback.herokuapp.com/?log=true Full code: https://github.com/franklovecchio/playback You’ll see the undefined attributes come through on the

  • 0

Example: http://franklovecchio-playback.herokuapp.com/?log=true

Full code: https://github.com/franklovecchio/playback

You’ll see the “undefined” attributes come through on the error: Uncaught TypeError: Object #<Thing> has no method 'serializeData' after I return the model on parse override.

Initially, I bind a Collection to a CompositeView:

things = new App.Collections.Things()
things.fetch()

# Render
App.Pages.State.Action1.getLayout().content.show new App.CompositeViews.Action1Things(
  collection: things
)

Inside the collection parse method, I fetch more detailed information about the model (to return an attribute called extra, which renders as undefined:

class App.Collections.Things extends Backbone.Collection

  url: '/things'
  model: App.Models.Thing

  @trace initialize: () ->

  # Override response to get more detailed information about thing.
  @trace parse: (resp) ->

    things = []

    _.each resp, (item) =>

      # Fetch detailed information about thing
      thing = new App.Models.Thing(
        id: item.id
        name: item.name
      )

      thing.fetch()

      things.push thing

    things

Then, inside the model:

class App.Models.Thing extends Backbone.Model

  defaults:
    name: 'n/a'
    extra: 'n/a'

  urlRoot: () ->
    '/thing'

  defaults:
    name: null

  @trace initialize: () ->

    @name = @attributes.name
    @extra = @attributes.extra

  @trace parse: (resp) -> 

    debug.info 'resp: ' + JSON.stringify resp

    @id = resp.id
    @attributes.id = @id

    @name = resp.name
    @attributes.name = @name

    @extra = resp.extra
    @attributes.extra = @extra

    @

Commenting out:

@extra = resp.extra
@attributes.extra = @extra

Causes the error to go away, but the CompositeView doesn’t even attempt to update, than. How do I get the CompositeView to update on parse() completion with fetched model response?

(While the example doesn’t show it, I have to override because the response is not returned like Backbone wants it, in case you were wondering).

  • 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-10T10:46:47+00:00Added an answer on June 10, 2026 at 10:46 am

    I had to modify both the ItemView and the CompositeView’s on 'change' events:

    ItemView old:

    class App.ItemViews.Action1Thing extends Backbone.Marionette.ItemView
      template: '#template-action1-thing'
      @trace initialize: (options) ->
    
        @model.on 'change', @render
    

    ItemView new:

    class App.ItemViews.Action1Thing extends Backbone.Marionette.ItemView
      template: '#template-action1-thing'
      @trace initialize: (options) ->
    
        @model.on 'change', () ->
          @render
    

    CompositeView old:

    class App.CompositeViews.Action1Things extends Backbone.Marionette.CompositeView
    
      template: '#template-action1-things'
      collectionEl: 'tbody#things_collection'
      itemView: App.ItemViews.Action1Thing
    
      @trace initialize: (options) ->
    
        @collection.on 'change', @render
    

    CompositeView new:

    class App.CompositeViews.Action1Things extends Backbone.Marionette.CompositeView
    
      template: '#template-action1-things'
      collectionEl: 'tbody#things_collection'
      itemView: App.ItemViews.Action1Thing
    
      @trace initialize: (options) ->
    
        @collection.on 'change', (model) ->
          @.remove model
          @.add model
          @render
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example http://twitter.github.com/bootstrap/base-css.html try to scroll up. You will see the bar with Typography
we have this example: http://code.google.com/apis/maps/documentation/v3/basics.html#DetectingUserLocation which shows how to get the user's position in
In the following example http://twitter.github.com/bootstrap/base-css.html#forms There is a text field with text Type something...
Click here to see example http://www.messtudios.com/form/ Now, when you click on Create Account -
example: http://www.ehow.com/how_2196172_ping-mac-computer.html As you can see the helpful? element is stuck in place even
Example : http://www.net-a-porter.com/product/163606 So far my code: <style type=text/css> li {float:left;height:50px} </style> <div style=height:100px>
Example: http://mrdoob.github.com/three.js/examples/canvas_geometry_birds.html I wish to incorporate the above script into my one home page
Example: http://bit.ly/dfjvmT If you take a look at that URL, you will see an
Example: http://jqueryui.com/demos/dialog/#modal-confirmation The example shown allows you to view the source and even has
Example: http://vincent-massaro.com/map/ Currently, the script allows you to click on a piece of the

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.