Comments (7)
Thanks, I've pushed a change to fix this (CS branch).
You have to call save() on the instance to save attributes, that's kinda the point ;) - or maybe I'm misunderstanding?
from spine.
I want to set attributes on the model that I don't want persisted to the server. For example, I'm storing a count
with my Item models, so that the view for the Item can display its count. The count is calculated by a controller, and I don't want to persist it. What's the correct approach to storing the count with a model?
from spine.
Side note: Backbone has Model.save
and Model.set
. The save
method is like Spine's save: it persists the new attributes. The set
method sets attributes on the Model without persisting them (which is what I'm looking for here).
from spine.
Ok, so you want to save models without triggering ajax requests? One way to do this is with Spine.Ajax.disable()
Spine.Ajax.disable -> instance.save()
from spine.
But I still want to persist everything else, not disable Ajax completely. Is this a clean way to temporarily disable it?
from spine.
Have a closer look at that example - it only disables it for that specific
save (any save in the callback function).
On Mon, Aug 1, 2011 at 5:41 PM, chetan51 <
[email protected]>wrote:
But I still want to persist everything else, not disable Ajax completely.
Is this a clean way to temporarily disable it?Reply to this email directly or view it on GitHub:
https://github.com/maccman/spine/issues/83#issuecomment-1704929
Alex MacCaw
+12147175129
@maccman
http://alexmaccaw.co.uk | http://www.leadthinking.com | http://socialmod.com
from spine.
Ah, I didn't realize it's in a callback function. Thanks!
from spine.
Related Issues (20)
- code help( help with the completion of the code to run well) HOT 3
- testing new issue HOT 5
- Why there are two different spinejs? HOT 4
- Do not mix up instance property and local variable HOT 5
- Broken link to coffeescript in README
- Crashes if the browser doesn't support localStorage HOT 1
- Triggering refresh on model instance no longer triggers refresh on the model class HOT 9
- `isBlank` suppose to check the number? HOT 4
- Support multiple remote hosts (override Spine.Model.host) HOT 1
- 1.6 ajax create success and then auto ajax update HOT 9
- hasOne and hasMany calls inconsistent
- listeningTo the same event on different models is broken (events.split / cannot read property 'obj' of undefined / etc.) HOT 3
- Extend POST/DELETE fix from 1.6.0 to PUT calls HOT 1
- spinejs.com domain registration has expired HOT 3
- Model#changeID does not persist the new id HOT 1
- Documentation link in README.md is broken HOT 2
- Model foreign key reference with no id broken HOT 2
- Model.find unable to get correct result
- Hello. Is this project abandoned? HOT 2
- Pug support
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 spine.