1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    11
    Vote Rating
    0
    gnanbu is on a distinguished road

      0  

    Exclamation How To Get the Radio Button value

    How To Get the Radio Button value


    Hi,
    I use ExtJs Designer tool for gui Development. I tried to get radio box value but it showing error for me. can any one tell me how to get the value. Here i need Radio Group, but i don't know how to get radio group button in EXTJS designer tool. So i tried like that Here i attached my code for reference. Please Help me.

    Code:
    this.items = [
                {
                    xtype: 'fieldset',
                    title: '',
                    x: 10,
                    y: 140,
                    width: 780,
                    height: 200,
                    layout: 'absolute',
                    hideBorders: true,
                    id: 'selectCriteriaFieldSet',
                    items: [
                        {
                            xtype: 'label',
                            text: 'Translater',
                            x: 350,
                            y: 10,
                            id: 'searchId'
                        },
                        {
                            xtype: 'button',
                            text: 'Submit',
                            x: 350,
                            y: 120,
                            height: 22,
                            width: 70,
                            id: 'searchButton'
                        },
                        {
                            xtype: 'radio',
                            x: 350,
                            y: 40,
                            boxLabel: 'Upload',
                            name: 'SelectionRd',
                            inputValue: 'upload',
                            id: 'upload'
                        },
                        {
                            xtype: 'radio',
                            x: 350,
                            y: 70,
                            boxLabel: 'View/Edit/Download',
                            name: 'SelectionRd',
                            inputValue: 'view',
                            id: 'view'
                        }
                    ]
                }
            ];
    When click the button like below
    Code:
    this.findById('searchButton').on('click', function(button, event){
                            var radioValue = Ext.getCmp('SelectionRd').getValue();
                                          Ext.Msg.alert('ALERT',radioValue);
                            
            });
    Here i got error.The Error is :Unable to get value of the property 'getValue': object is null or undefined
    Last edited by aconran; 3 Nov 2011 at 3:09 PM. Reason: add code tags

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    20
    Vote Rating
    0
    livensnick is on a distinguished road

      0  

    Default


    Your problem is the Ext.getCmp('SelectionRd') will try to find a component with ID 'SelectionRd' which does not exist.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    11
    Vote Rating
    0
    gnanbu is on a distinguished road

      0  

    Exclamation


    Dear livensnick,

    Can you help me how can i get the value, where i can modify code?. I don't know how to do. Please help me.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Don't use id, it's a bad practice. Use ComponentQuery if on Ext JS 4.x or ST 1.x/2.x:

    Code:
    this.down('radiofield[inputValue=upload]');
    this.down('radiofield[inputValue=view]');
    The first will get the first child that is a radiofield and has an inputValue property matching upload. The second is the same only it gets the on where inputValue is view.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    11
    Vote Rating
    0
    gnanbu is on a distinguished road

      0  

    Exclamation Problem In Grid Panel

    Problem In Grid Panel


    Hi Sir,

    I'm using EXT-JS 3 and EXT - Js Designer Tool also and i tried to add grid panel but its showing error like
    Line: 48215
    Error: Unable to get value of the property 'getSortState': object is null or undefined.

    I didn't know why.can you Please help me how resolve this. And i don't how to add file upload button like browse button in that designer. can you help me if you know ?

  6. #6
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    1
    Vote Rating
    0
    marcinn is on a distinguished road

      0  

    Default


    I also have difficulties to read the radiobutton values. Where do I put the logic here? Do those calls return true/false? When I do getForm().getValues(), I only get the information the radio is 'on' and not which element is selected...

    thank you,

    Quote Originally Posted by mitchellsimoens View Post
    Don't use id, it's a bad practice. Use ComponentQuery if on Ext JS 4.x or ST 1.x/2.x:

    Code:
    this.down('radiofield[inputValue=upload]');
    this.down('radiofield[inputValue=view]');
    The first will get the first child that is a radiofield and has an inputValue property matching upload. The second is the same only it gets the on where inputValue is view.