Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get radiogroup checked value using extjs 4?

I am using extjs 4 for radio buttons. Code is as follow

var mychkbxgrp = Ext.create('Ext.form.RadioGroup',{
    fieldLabel: 'Layer',
    columns: 1, 
    items:[{
     boxLabel: 'District', name: 'rb', inputValue: 'district',itemId:"DIS"
    },{
     boxLabel: 'SubDistrict', name: 'rb', inputValue: 'Subdistrict',itemId:"sub"
    },{
     boxLabel: 'Village', name: 'rb', inputValue: 'Village'
    },{
     boxLabel: 'Road', name: 'rb', inputValue: 'Roads'
    },{
     boxLabel: 'Point', name: 'rb', inputValue: 'POINT'
    }],
    listeners: {
     change : function(){ 
         alert(this.getValue());
        }
    }
    });

I want to get the value of checked radio button once its checked. for that i have used listeners but not working. Am i right or need to use other way. please help me for same.

like image 670
Pari Avatar asked Jan 18 '26 16:01

Pari


2 Answers

You can use the function getChecked()

like image 161
Renganathan M G Avatar answered Jan 21 '26 09:01

Renganathan M G


I've tried many solutions, and following one worked only. Hope it helps

listeners: {
     change : function(obj, value){ 
         alert(value.individual);
        }
    }
like image 30
Raza Ahmed Avatar answered Jan 21 '26 08:01

Raza Ahmed