Results 1 to 5 of 5

Thread: Disable radio button in radio group

  1. #1
    Ext User
    Join Date
    Nov 2007
    Location
    SP, Brazil
    Posts
    9

    Question Disable radio button in radio group

    Hi everyone!

    Is it possible to disable a radio button that belongs to a radio group?

    I tried to use disable() and setDisabled(true) but it didn

  2. #2
    Touch Premium Member msuresh's Avatar
    Join Date
    Dec 2007
    Location
    Bangalore, India
    Posts
    220

    Default

    Try this.

    Code:
    var crtRdo=new Ext.form.Radio({
                xtype:"radio",
                name:"mtype",
                inputValue:"radiovalue"
              });
    crtRdo.disable();
    Try to add this Standard override.

    Code:
    Ext.override(Ext.form.Radio, {
        onClick : function(){
        	if(this.el.dom.checked != this.checked){
        	    var els = this.el.up('form').select('input[name='+this.el.dom.name+']');
        	    els.each(function(el){
        	        if(el.dom.id == this.id){
        	            this.setValue(true);
        	        }else{
        	            Ext.getCmp(el.dom.id).setValue(false);
        	        }
        	    }, this);
            }
        }
    });

  3. #3
    Ext User
    Join Date
    Nov 2007
    Location
    SP, Brazil
    Posts
    9

    Default Almost...

    Msuresh, please look if I did right...

    [CODE]
    firstOption = new Ext.form.Radio({
    xtype: 'radio',
    inputValue: '1',
    name: 'firstOption',
    boxLabel: 'Listar os rate plans com o tipo e n

  4. #4

    Default

    ExtJS 6.5

    Code:
    Ext.define('Overrides.form.field.Radio', {
      override: 'Ext.form.field.Radio',
    
      initComponent: function (radio) {
        radio.dom.onclick = function(){
          radio.setValue(!radio.value );
        }
      }
    });
    Thanks
    Albanir Neves

  5. #5

    Default

    Thank You.
    It is working.
    Semidot Infotech known as top mobile and web development company.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •