Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    263
    Vote Rating
    1
    maquejp is on a distinguished road

      0  

    Exclamation [FIXED-609] RadioGroup Readonly

    [FIXED-609] RadioGroup Readonly


    Hi,

    I am trying to use the setReadOnyl(true) public method of the Class Ext.form.RadioGroup.
    But I am still able to click and change the values (I can select one of the other option)


    Within a formpanel
    Code:
    			new Ext.form.RadioGroup({id:'TENPERBUDGNOTRECEI',name:'TENPERBUDGNOTRECEI',allowBlank: false,columns: 3,columns: [100, 100, 100],
    			fieldLabel:'At least 10% of the budget must be allocated to organisations that have not received any funding under the HP of the EC in the past 5 years',
    			items:[
    			{boxLabel: 'YES',name:'TENPERBUDGNOTRECEI',inputValue: '1'},
    			{boxLabel: 'NO',name:'TENPERBUDGNOTRECEI',inputValue: '0'},
    			{boxLabel: 'N/A',name:'TENPERBUDGNOTRECEI',inputValue: '9'}]})
    in the .getForm().load({...success...
    Code:
    if (Ext.getCmp('PERCENTTOTBUDGREQUESTFLAG').getValue() == 'NO') {
    Ext.getCmp('TENPERBUDGNOTRECEI').setValue(9);
    Ext.getCmp('TENPERBUDGNOTRECEI').setReadOnly(true);
    }
    The .setDisabled(true) works but the forced value is not sent as the input is disabled...

    In advance, thank you

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Yes, it seems that readOnly option of RadioGroup is ignored (disabled option works). Now, I don't know if readOnly should be supported and is not - that would be Ext bug or if it shouldn't be supported but is documented - that would be documentation bug.

    Nevertheless, moving the thread to Bugs forum.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    263
    Vote Rating
    1
    maquejp is on a distinguished road

      0  

    Default


    OK, I will wait for an answer and write at the server side the specific condition (if not passed, force database value)...

    Thanks

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    [type]: fix
    [module]: CheckboxGroup
    [id]: #609
    [desc]: Fixes #609. CheckboxGroup/RadioGroup will now apply setReadOnly to their child items.

  5. #5
    Ext JS Premium Member
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    263
    Vote Rating
    1
    maquejp is on a distinguished road

      0  

    Default


    Is it part of 3.1.2?

  6. #6
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    No, this will be in 3.2

  7. #7
    Ext JS Premium Member
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    263
    Vote Rating
    1
    maquejp is on a distinguished road

      0  

    Default


    ok, thanks

  8. #8
    Sencha User
    Join Date
    May 2010
    Posts
    4
    Vote Rating
    0
    kpalser is on a distinguished road

      0  

    Default


    Has this definitely been fixed for 3.2.1? I still have the same issue. After I use setReadOnly(true), I can still change the selected radio button:

    Ext.getCmp("radiogroup-sexo").setReadOnly(true);

    Code:
    {
      xtype: 'radiogroup',
      columns: 2,
      name:'sexo',
      id:'radiogroup-sexo',
      items: [
           {boxLabel: 'V', name: 'sexo', inputValue:'V'},
           {boxLabel: 'H', name: 'sexo', inputValue:'H'}
                ]
    },

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,054
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Browsers don't recognize readOnly on checkboxes/radios. The best you can do is disable them.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  10. #10
    Ext JS Premium Member dtex-lab's Avatar
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    341
    Vote Rating
    1
    dtex-lab is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    Browsers don't recognize readOnly on checkboxes/radios. The best you can do is disable them.
    A solution can be into Ext.form.RadioGroup:

    Code:
        bufferChecked : function(){
        if(this.readOnly)
           {
         this.reset();
         return false;
        }
     
            var out = null;
            this.eachItem(function(item){
                if(item.checked){
                    out = item;
                    return false;
                }
            });
            this.fireEvent('change', this, out);
        },
    Evant (ExtJS Team), can you check if it is a valid solution also for you and implements it in a next ExtJS Release?

    It is working for me.
    Ty
    Last edited by dtex-lab; 30 Jun 2010 at 6:58 AM. Reason: Reopen issue
    we make IT work for you