Results 1 to 4 of 4

Thread: BasicForm isDirty() is not work with trackResetOnLoad option

  1. #1
    Sencha User alexey.goloburdin's Avatar
    Join Date
    Mar 2011
    Location
    Moscow, Russia
    Posts
    2

    Default BasicForm isDirty() is not work with trackResetOnLoad option

    Hi to all!

    Extjs API docs contains some information about isDirty() method of BasicForm element:
    Returns true if any fields in this form have changed from their original values.
    Note that if this BasicForm was configured with trackResetOnLoad then the Fields' original values are updated when the values are loaded by setValues or loadRecord.
    So, if i set trackResetOnLoad to TRUE in BasicForm or FormPanel config, isDirty() must return false after setValue() action applied to one of form fields. But it not works for me!

    For example, i write this code:
    PHP Code:
        var form = new Ext.FormPanel(
            {
                
    renderToExt.getBody(),
                
    frametrue,
                
    title'My test form',

                
    trackResetOnLoadtrue// note, please

                
    items: [
                    {
                        
    xtype'textfield',
                        
    fieldLabel'First field',
                        
    name'first'
                    
    }
                 ]
            }
        );

        
    console.log(form.getForm().isDirty()); // return FALSE

        // set some value to Form element...
        
    form.getForm().findField('first').setValue('some value');

        
    console.log(form.getForm().isDirty()); // return TRUE 
    Last isDirty() call must return false. What's wrong?

    PS. Sorry for my English, yeah.

  2. #2
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750

    Default

    I think you've mistaken setValue (no "s"!) with setValues as the docs say.

  3. #3
    Sencha User alexey.goloburdin's Avatar
    Join Date
    Mar 2011
    Location
    Moscow, Russia
    Posts
    2

    Default

    fay, thanks for answer! You are quite right.
    But what is about clear dirty mark after setValue() to some form field?

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2011
    Location
    Reston, VA
    Posts
    53

    Default

    I would like an answer to this as well. I'm using setValue() on specific fields, and I need to clear their dirty marker...doesn't seem like there's an easy way to do that.

Similar Threads

  1. BasicForm.setValues & trackResetOnLoad
    By XASD in forum Ext 3.x: Bugs
    Replies: 0
    Last Post: 1 Mar 2011, 12:46 AM
  2. Form.isDirty() with trackResetOnLoad: true
    By mohaaron in forum Ext 3.x: Help & Discussion
    Replies: 15
    Last Post: 10 Jan 2011, 10:42 AM
  3. Replies: 1
    Last Post: 29 Jul 2010, 7:30 PM
  4. Changed isDirty/trackResetOnLoad behavior in 3.0-rc2 froim from 2.2.1
    By cormip in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 30 Jun 2009, 3:07 PM

Tags for this Thread

Posting Permissions

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