-
31 Oct 2011 4:16 AM #1
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.
When click the button like belowCode: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' } ] } ];
Here i got error.The Error is :Unable to get value of the property 'getValue': object is null or undefinedCode:this.findById('searchButton').on('click', function(button, event){ var radioValue = Ext.getCmp('SelectionRd').getValue(); Ext.Msg.alert('ALERT',radioValue); });Last edited by aconran; 3 Nov 2011 at 3:09 PM. Reason: add code tags
-
31 Oct 2011 6:32 AM #2
Your problem is the Ext.getCmp('SelectionRd') will try to find a component with ID 'SelectionRd' which does not exist.
-
31 Oct 2011 5:15 PM #3
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.
-
1 Nov 2011 4:49 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Don't use id, it's a bad practice. Use ComponentQuery if on Ext JS 4.x or ST 1.x/2.x:
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.Code:this.down('radiofield[inputValue=upload]'); this.down('radiofield[inputValue=view]');Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Nov 2011 9:09 PM #5
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 ?
-
2 Aug 2012 2:55 AM #6


Reply With Quote