Backbone.js - How to model a nested list -


i trying model multi-level nested list in backbone , wondering how best model collections/models.

i have (in coffeescript)

my collection

class app.collections.list extends backbone.collection    model: app.model.listitem 

my model

class app.model.listitem extends backbone.model    defaults:       name: "foo"      bar:  "bar"      children: new app.collections.list # doesnt work because need load models before collections      parent: # initialized param hash 

i initialize view e new app.collection.list (of listitem models) gives list of depth 1. when click on listitem want perform http get, can populate it's children with, , on , forth. have 3 levels deep grow deeper.

should use supermodel [1] or backbone-relational [2]?

[1] http://pathable.github.com/supermodel/

[2] https://github.com/pauluithol/backbone-relational


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -