Comments (4)
Associations are supposed to work like:
init : function(){
this.hasMany("CN.Models.Loan","loans");
this.hasMany("CN.Models.Issue","issues");
this.hasMany("CN.Models.Note","notes");
this.belongsTo("CN.Models.Person","person")
}
The idea is if you got data like:
[
{
loans : [{ ... }],
issues: [{ ... }],
notes: [{ ... }],
person : { ... },
},
...
]
The models would create instances of CN.Models.Loan so you could access them like:
customer.loans()[0].destroy();
from jquerymx.
This was used on our first 3.0 app. I haven't gotten to cleaning up model yet, but I will take a look at this, probably this week.
from jquerymx.
Oh, yeah, I'm doing this manually in my load data callback with wrapMany. Would be nice to use this plugin instead.
from jquerymx.
Plugin should be working. Reopen if I am wrong.
from jquerymx.
Related Issues (20)
- formParams() can now only be called on <form> element. formParams() called on other than <form> element returns undefined HOT 2
- Case sensitive file system creates problem HOT 2
- View is never rejected when template is not found HOT 1
- jquery tmpl noConflict
- Cookie: jQuery.evalJSON and jQuery.toJSON HOT 2
- Docs Typo: $.route.attr vs $.route.attrs
- Templated Event Listeners string replacement problem HOT 2
- Fixture does not return correct datatype when error is thrown
- $.Model.delete URL cannot be templated beyond {id} HOT 2
- $.fn.val.call([el]) breaks other jQuery plugins
- $.fixture.make always filters out any fixtures when 'parentId'-like param is present
- $.fn.model(s) ignores type parameter.
- JQueryMX breaks when JQuery is in no-conflicts mode HOT 1
- Default fixture path is hardcoded
- $.fixture templated values not being included in callback data
- jQueryMX breaks when jQuery is in not in global scope HOT 1
- Subclasses of $.Observe are not applied to attribute values HOT 2
- Documentation bug in Controller tutorial
- Bug in remove() from $.Model.List class
- Change <% %> delimeters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquerymx.