1. #1
    Sencha User bclinton's Avatar
    Join Date
    Nov 2007
    Posts
    265
    Vote Rating
    5
    bclinton will become famous soon enough

      0  

    Default Field isDirty function change

    Field isDirty function change


    I see that the isDirty() function in Ext.form.field.Field has been changed in the 4.1 preview release.

    This is the function in 4.07:
    Code:
        isDirty : function() {
            var me = this;
            return !me.disabled && !me.isEqual(me.getValue(), me.originalValue);
        }
    ,

    In the 4.1 PR1, the function disregards changes in fields with an undefined originalValue:
    Code:
        isDirty : function() {
            var me = this;
            return !me.disabled && typeof me.originalValue != 'undefined' && !me.isEqual(me.getValue(), me.originalValue);
        },
    Is there a reason for this change and can we expect it to remain this way in the future?

    This change broke some of my code, but in a way that exposed another bug in my code related to the issue where the trackResetOnLoad config option doesn't get passed from the FormPanel to the Ext.form.Basic when specified in the config or initialConfig as discussed in this thread:

    http://www.sencha.com/forum/showthread.php?144109-Recommended-way-to-configure-form.Basic-from-form.Panel-in-Ext-4-with-Ext.define

    Both of these issues seem like they might create confusion for users:

    In the first, a field won't show as dirty if it hasn't been initialized with a value. It seems to me that a field that has had its value changed from undefined to something else should be considered a dirty field.

    The second issue, that trackResetOnLoad configs don't get passed to the basic form when extending FormPanel, might increase the confusion because when loads are not tracked, all fields in a form have an originalValue of undefined.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,711
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Just looking at the code it looks like the dirty status was incorrect when the field was instantiated and checked for dirty status. Anything can change but without a bug report it likely will not change.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User bclinton's Avatar
    Join Date
    Nov 2007
    Posts
    265
    Vote Rating
    5
    bclinton will become famous soon enough

      0  

    Default


    I originally posted here because I wasn't sure if it was a bug or if it is the intended behavior.

    Just in case, I posted a bug report and a test case here: http://www.sencha.com/forum/showthre...892#post705892

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar