Results 1 to 2 of 2

Thread: [DEFER] Field original values lost if values set before render.

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    1
    Vote Rating
    0
      0  

    Default [DEFER] Field original values lost if values set before render.

    I have a form in an Ext.Window.
    I have set value to '' in the config object for all fields.

    The form gets used in two situations (adding and editing).
    When editing, values are added into the form using Ext.form.BasicForm.setValues(), and then the window is displayed.
    When adding, the form is reset using Ext.form.BasicForm.reset(), and then the window is displayed.

    If the first thing done is an edit, then the values that were set with setValues() overwrite the originalValue property of each field! This means that on later adds, the form is filled with the values from that original edit.

    This is caused because when the field is rendered, Field.initValue() sets the originalValue property from the field's value.

    This problem can be worked around either by always setting values instead of resetting the form, or by showing the window before setting values into it.


    I think that either originalValue should be set in the constructor, or it should be remembered separately from value, so that initValue() can use the correct originalValue, or this situation should be clearly documented in the API docs.

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    This is a limitation currently as the forms use the dom for storage currently. This is being changed in 4.x to be within the component by default.

Similar Threads

  1. When to set field values?
    By fermo111 in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 28 Dec 2009, 3:35 AM
  2. Ext.BasicForm.reset dumps original values for hidden fields
    By wwarby in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 24 Nov 2009, 12:21 PM
  3. passing values other than 'dataIndex'(multiple values) in grids ColumnModel
    By dHANEESH in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 2 May 2009, 4:07 AM
  4. Where are original store values held
    By Padster in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 28 Aug 2008, 7:03 AM
  5. Form, saving and original values
    By thzero in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 30 May 2008, 1:27 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
  •