-
29 Dec 2011 12:30 PM #1
Unanswered: fire event on radio field Change and get changed value
Unanswered: fire event on radio field Change and get changed value
I am having some issues with the radio field event firing and getting the right values for radio field selected.
This is the popup which is loaded based on JSON data.Code:// All the Radio Fields are dynamically added into this panel var resultList = Ext.create('Ext.Panel', { scrollable: 'vertical', width: 285, height: 190, initialize: function () { this.callParent(); this.element.on({ tap: function (ctl) { // var value1 = Ext.ComponentQuery.query("radiofield").getValue(); var value = ctl.target.value.split('|'); popup.hide(); var rtndata = [value[1], value[2]]; alert(rtndata); } }); } });
Store : which loads the popup with radio fields.Code:var popup = Ext.create('Ext.Panel', { floating: true, modal: true, centered: true, width: 300, height: 200, layout: 'fit', hideOnMaskTap: false, items: [resultList] });
The Store works perfectly fine and populate the popup with radio fields. Now when i select the radio field i am not able to get the selected value. Can any one help me getting the selected value when the user changes the selection.Code:Ext.define('Parking.store.Searches', { extend: 'Ext.data.Store', model: 'Parking.model.LocationSearch', remoteFilter: true, proxy: { type: 'flickr', query: 'search', reader: { type: 'json', root: function (data) { if (data.error || data.Results.Length === 0) { return []; } else { var radios = []; Ext.each(data.Results, function (address) { radios.push({ xtype: 'radiofield', name: 'radiogroup', value: address.Representation + "|" + address.Latitude + "|" + address.Longitude, label: address.Representation, labelWidth: '85%' }); }); resultList.add(radios); popup.show(); return data.Results } } } } });
-
29 Dec 2011 12:33 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
- Answers
- 3153
The check/uncheck events aren't firing?
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.
-
29 Dec 2011 12:40 PM #3
No. I am not sure whether i have put the listeners in the right position. only the tap event seems to work .
The resultList contains a group of radio fields. I am basically trying to get the selected field when the user checks a field.
-
29 Dec 2011 12:44 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
- Answers
- 3153
Each radio field will fire the check and uncheck events.
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.
-
29 Dec 2011 1:03 PM #5
Thanks mitchellsimoens. I have been adding the listeners for the radio field in the panel. so it was basically taking the panel values than the radio field. once i adding the listener when i create the radio fields dynamically things started to work.


Reply With Quote