Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7676499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:12:48+00:00 2026-05-31T17:12:48+00:00

What is the accepted strategy for ensuring that models loaded from a server and

  • 0

What is the accepted strategy for ensuring that models loaded from a server and then subsequently changed in the UI (i.e. ExtJS) and sent back to the server are saved properly?

The issue we are seeing in an application is that models can be saved without them being properly loaded. This may lead to incomplete models being saved.

e.g. on the server the model has these properties:

color: blue
size: 10
weight: 20

The user loads the model, and during the loading process the user changes

color: red

and saves. As a result, the model loses its weight and size properties on the server. Please note that this is a radical oversimplification of our scenario. The models are much more complex and the amount of data much bigger.

Strategies I can think of:

  1. Ensure everything is loaded before allowing users to save (inelegant, I think).
  2. Keep track of changes in the model, only save the changes. This would not require the model to be fully loaded, as only those things that a user actively edits get saved back to the backend (no idea whether this is supported in ExtJS out of the box).

Can someone point me in the right direction? Could Ext.data.Record.getChanges / isModified be used to implement the 2nd approach? How are deletions handled by ExtJS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:12:49+00:00Added an answer on May 31, 2026 at 5:12 pm

    When you need to save a model that has never been saved, you do this:

    model.save();
    

    This method automatically calls the Ext.data.proxy.Proxy.create() method.

    If you need to update the model with some fresh data or even replace the existing data, you do this:

    model.set('property', 'value');
    

    This one, in the other hand, automatically calls the Ext.data.proxy.Proxy.update() method.

    Then you can work with the model class constants referring to the action status:

    • Ext.data.Model.EDIT
    • Ext.data.Model.REJECT
    • Ext.data.Model.COMMIT

    @charris brings a nice example as a comment on the official docs:

    var myStore = Ext.create('Ext.data.Store', {
      model: 'MyApp.model.MyModel',
      listeners: {
        update: function(store, model, operation, eventOptions) {
          if( operation == Ext.data.Model.EDIT ) {
              // Model was edited but not saved...
          }
          else if( operation == Ext.data.Model.COMMIT ) {
              // Model was saved...
          }
        }
      }
    });
    

    Maybe that will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is generally accepted that the use of cursors in stored procedures should be
It's generally accepted that copy and paste programming is a bad idea, but what
I'm trying to implement the pattern that's introduced by this question The accepted answer
I accepted a pull request from my developer and merged his changes into my
What are the accepted practices for creating a Tomcat deployment that reads configuration parameters
My app has been accepted by Apple and I just downloaded the version from
It's generally accepted that problems that can be solved in polynomial time are tractable
I think it is accepted that as a general rule in Java (and perhaps
It is well accepted that assertion functions that check a single value/object have names
UPDATE 2/13/2012: Accepted an answer, explained that this behavior is a bug, and noted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.