Results 1 to 2 of 2

Thread: How can I force a data.store to save a record to the server

  1. #1
    Sencha User
    Join Date
    Feb 2009
    Posts
    75
    Vote Rating
    -1
      0  

    Default How can I force a data.store to save a record to the server

    I am loading records with an extDirect data store. I display a record in a form, then call:

    Code:
            this.getForm().updateRecord(this.record);
    If I have made changes in the form, the record will be written to the server as expected.

    However, I have a case where I need to programmatically change one of the fields in the record, and the user may not need to change anything manually. In that case, the record is not written to the server, because somewhere something is being "smart" and thinks there was no change.
    I tried calling:

    Code:
    this.record.setDirty ();
    after updateRecord, but it had no effect. I also tried:

    Code:
    this.record.commit ();
    That did not work either.
    Any other suggestions?

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Location
    SC - Brazil
    Posts
    27
    Answers
    3
    Vote Rating
    4
      0  

    Default

    How you changed the record data? You used the set method of your model to set the property values?
    The set method will automatically mark the model as changed...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •