Code Monkey home page Code Monkey logo

Comments (7)

maccman avatar maccman commented on June 12, 2024

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.

chetan51 avatar chetan51 commented on June 12, 2024

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.

chetan51 avatar chetan51 commented on June 12, 2024

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.

maccman avatar maccman commented on June 12, 2024

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.

chetan51 avatar chetan51 commented on June 12, 2024

But I still want to persist everything else, not disable Ajax completely. Is this a clean way to temporarily disable it?

from spine.

maccman avatar maccman commented on June 12, 2024

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.

chetan51 avatar chetan51 commented on June 12, 2024

Ah, I didn't realize it's in a callback function. Thanks!

from spine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.