Results 1 to 3 of 3

Thread: Form loaded using JSON is always dirty?

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    33

    Default Form loaded using JSON is always dirty?

    When using a formPanel, that is loaded using:

    PHP Code:
    loadForm = function(){
      
    myForm.load({
        
    url'./api/GetUserInfo.php'   //returns JSON string
     
    }); 
    Where the form uses a JSONReader tot parse the data, all fields seem to be marked "dirty", with an initial value of "".

    PHP Code:
    myForm.getForm().findField('EmailAddress').isDirty();   //Always true 
    How do I prevent this from happening? Should I load the form before render? Or should I somehow mark the fields as unmodified (clean?) after loading? Or am I doing something else wrong here?

    I want to be able to warn a user upon submit when he/she changed his/her email address, since this is also their login name.

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    You want trackResetOnLoad:true.

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Posts
    33

    Default

    Thanks Connor, that is exactly what I needed! Works like a charm

Similar Threads

  1. Replies: 2
    Last Post: 13 Dec 2010, 10:16 AM
  2. [FIXED-587] Records loaded marked dirty
    By omarc in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 22 Nov 2010, 6:03 PM
  3. WHY: TextArea not being updated via form loaded JSON data?
    By wgpubs in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 24 Aug 2009, 9:23 PM
  4. Dirty form
    By cooldude87801 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Dec 2007, 3:57 PM

Posting Permissions

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