Giter Site home page Giter Site logo

Auto save about project-phoenix HOT 3 CLOSED

gordon-cs avatar gordon-cs commented on July 19, 2024
Auto save

from project-phoenix.

Comments (3)

superpowers11 avatar superpowers11 commented on July 19, 2024 1

Hmm, I don't think adding the DamageId would require impossible amounts of magic. Can't you just return it on the AJAX response and then add it to the element?
So instead of having these two different states of damages in the UI (some in the db, some not), we just make the UI always reflect what is indeed in the db?

from project-phoenix.

superpowers11 avatar superpowers11 commented on July 19, 2024

Can this be done by simply saving to db each time a description is entered, using an AJAX call? We were worried that would decrease performance and cause too many unnecessary db calls, especially if users decide to delete. But how often will a user delete a damage description they themselves just entered? And if it is an asynchronous call, the user should be able to continue their work even as the call to db is being made, no?

Isn't that supposed to be the beauty of AJAX?

from project-phoenix.

eanyanwu avatar eanyanwu commented on July 19, 2024

We were worried that would decrease performance and cause too many unnecessary db calls, especially if users decide to delete.

I don't think that is the issue. If we make an AJAX call to add the damage to the db, the UI doesn't reflect that. The new damage still has the "new-damage" class insteady of being tagged with its DamageID (so it can be deleted later).
If we were to save on each damage addition, we would either:

  • Need to refresh on each addition.....lolno
  • Need to do some jquery magic to get the DamageID of the newly inserted component and give it an ID that reflects that.

from project-phoenix.

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.