1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    16
    Vote Rating
    3
    stevestorey is on a distinguished road

      0  

    Default [2.0rc1] Ext.form.Checkbox.setRawValue has no effect

    [2.0rc1] Ext.form.Checkbox.setRawValue has no effect


    Hi,

    I couldn't find anything about this in the rest of the forum, so I'm reporting a bug for it. I have a checkbox, which has a handler to ask the user to confirm they want to uncheck it (as it removes some data permanently if they do).

    I do this with a Ext.MessageBox.confirm dialog box called from the "check" handler of the checkbox. If the user clicks "No", then I won't remove the data, but I also need to have the checkbox become checked again. Using setValue works, but also fires the handler, which I don't really want, as it's then difficult to detect whether it was a user click, or as a result of the above handler. I'd rather use setRawValue, but this doesn't work for checkboxes, as it's not overridden to set "checked" on the DOM element.

    Suggested code in the Checkbox function would be:

    1. Remove the following code:

    Code:
        setValue : function(v){
            this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on');
            if(this.el && this.el.dom){
                this.el.dom.checked = this.checked;
                this.el.dom.defaultChecked = this.checked;
            }
            this.fireEvent("check", this, this.checked);
        }
    2. Replace with

    Code:
        setRawValue : function(v){
            this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on');
            if(this.el && this.el.dom){
                this.el.dom.checked = this.checked;
                this.el.dom.defaultChecked = this.checked;
            }
        },
    
        setValue : function(v){
            setRawValue(v);
            this.fireEvent("check", this, this.checked);
        }
    This will also apply to Radio buttons by the looks of things in the code.

    thanks,

    Steve

  2. #2
    Sencha Premium Member
    Join Date
    Jun 2007
    Posts
    59
    Vote Rating
    0
    ftftft is on a distinguished road

      0  

    Default


    I think it is a bug at 2.0.2 too.

  3. #3
    Ext User dlbjr's Avatar
    Join Date
    Oct 2007
    Location
    Cache, OK USA
    Posts
    280
    Vote Rating
    3
    dlbjr is on a distinguished road

      0  

    Default release click event

    release click event


    Why not unregister the check event , set it to checked, then reregister the check event when auto setting to checked = true?
    dlbjr - David L. Bryant Jr.

    Owner of
    dlbjr Technology Consulting
    Web2 System Developer & Consultant
    Focused on C.I. - Six Sigma - Shingo - Lean Technologies
    dlbjr.consulting@gmail.com

    Owner of:
    Attractive Graphics - "custom screen printing"
    attractivegraphicscsp@gmail.com

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2007
    Posts
    59
    Vote Rating
    0
    ftftft is on a distinguished road

      0  

    Default


    Quote Originally Posted by dlbjr View Post
    Why not unregister the check event , set it to checked, then reregister the check event when auto setting to checked = true?
    Sure. There are workaround here. But it doesn't work like the document.

    setRawValue( Mixed value ) : void
    Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see setValue.

  5. #5
    Sencha User dangreenfield's Avatar
    Join Date
    Mar 2007
    Location
    Hawkes Bay, New Zealand
    Posts
    69
    Vote Rating
    0
    dangreenfield is on a distinguished road

      0  

    Default


    Just a heads-up... Even though this thread is a few years old, there is still no proper Checkbox setRawValue function. It inherits the Field function, which doesn't cater correctly to checkboxes. I assume that it's just been overlooked.

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