Results 1 to 4 of 4

Thread: [2.??] Record.commit()

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    228
    Vote Rating
    4
      0  

    Default [2.??] Record.commit()

    Record.commit() does not take into account if Record has already been commited,so you can get "double" commit,that not desirable in some circumstences.That looks really odd if you remember how careful "change" event handled for TextField and alike(value checked if it's really modified before firing "change").

    Thanks.

  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    a commit is a commit. what do you mean by "double commits"?
    (i'm thinking along the lines of database commits here.)

    could you post some demo code to better explain your situation?

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    228
    Vote Rating
    4
      0  

    Default

    a commit is a commit
    exactly-I could not make commit second time.
    Code of commit method for Record:
    Code:
            this.dirty = false;
            delete this.modified;
            this.editing = false;
            if(this.store && silent !== true){
                this.store.afterCommit(this);
            }
    all this code execute EVERYTIME I call commit(),particularly
    Code:
     this.store.afterCommit(this);
    that makes false assertion,if commit was done earlier.

    Thanks.

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,427
    Vote Rating
    858
      0  

    Default

    This isn't a bug, if you're explicitly calling commit on the record then that's what it will do.

    If your issue is the afterCommit being called, you can always have it commit silently.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Posting Permissions

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