[CLOSED] RadioGroup - isDirty evaluation

Page 2 of 2 FirstFirst 12
  1. #11
    Hi Fabrício,
    thank you for your suggestions. Since you consider the described behavior to be expected, I am afraid that the only workable solution in our case is IsDirty() override for RadioButton. The problem is that the value of the RadioButton and the result of its getValue() function are different (as I tried to indicate in the screenshots attached to the very first test case). Based on this finding (meaning this.value always seems to be correct unlike the this.getValue() function), the following override can be applicable:

    Ext.override(Ext.form.field.Radio, {
        isDirty: function () {
            var me = this;
            //return !me.disabled && !me.isEqual(me.getValue(), me.originalValue)
            return !me.disabled && !me.isEqual(me.value, me.originalValue);
    Fortunately, as you pointed out, the submitted form values are correct, and so this seems to be the only correction needed.

    Of course, without a deeper immersion in ExtJS code, I can't know if it's a general or sufficiently reliable solution, but so far it works well, at least in our applications.

    Thank you for your patience and helpful comments.

    The thread can be closed.

    Kind regards
  2. #12
    Hello again, Dan!

    Since you don't really rely on the name setting for anything else, you should be good. But just be wary of client-server communication as this is potentially what has the most potential in being affected.

    Quote Originally Posted by NewLink
    The problem is that the value of the RadioButton and the result of its getValue() function are different
    You're right, this is to be expected if more than one radio groups share the same name across a same page (or form, to be more specific). Unfortunately there's not much we can do here.

    Your override looks very clean and short so I doubt I would be able to suggest anything better than that for the path you decided to follow.

    Thanks for the feedback, and glad you could ultimately settle on a solution that fulfills your requirements!
    Fabrício Murta
    Developer & Support Expert
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] Problem with isDirty
    By infonext in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 27, 2014, 7:16 PM
  2. [CLOSED] Regex evaluation freezes the browser
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 05, 2013, 12:26 PM
  3. Replies: 2
    Last Post: Oct 10, 2012, 6:27 PM
  4. isDirty and textField
    By houdatahbaz in forum 1.x Help
    Replies: 4
    Last Post: Sep 01, 2011, 10:23 PM
  5. form isDirty
    By [WP]joju in forum 1.x Help
    Replies: 5
    Last Post: Jun 22, 2010, 10:53 PM

Posting Permissions