-
23 Oct 2012 7:19 PM #1
How do I access panel data from a button on a navigationvew bar?
How do I access panel data from a button on a navigationvew bar?
I'm new to Sencha Touch coming from native obj-c. In my controller, I have the following code below. My panel currently has data set to it from a previous list that's been pushed to the navigationview.<br>
<br>
onRecordingAction: function() {<br>
var actionButton = this.getActionButton();<br>
<br>
var overlay = new Ext.Panel({<br>
left: 0,<br>
modal: true,<br>
scroll: false,<br>
padding: 10,<br>
id:'actionPanel',<br>
layout: {<br>
type: 'vbox',<br>
align:'center',<br>
pack:'center'<br>
},<br>
items:[<br>
{xtype: 'spacer'},<br>
{<br>
xtype: 'button',<br>
ui:'action',<br>
id: 'startRecording',<br>
text: 'Start Recording',<br>
listeners: {<br>
tap: function() {<br>
var pnl = Ext.getCmp('actionPanel');<br>
<br>
//**** I need to access panel data here<br>
}<br>
}<br>
},<br>
{xtype: 'spacer'}<br>
]}).showBy(actionButton);<br>
},<br>
<br>
Any help appreciated.
-
25 Oct 2012 6:55 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,117
- Vote Rating
- 453
I cannot read your code.
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.
-
25 Oct 2012 10:14 PM #3
Sorry about that. Reposting code.
Sorry about that. Reposting code.
Code:showRecordingPanel: function() { var recordingButton = this.getRecordingButton(); var overlay = new Ext.Panel({ left: 0, modal: true, scroll: false, padding: 10, id:'actionPanel', layout: { type: 'vbox', align:'center', pack:'center' }, items:[ {xtype: 'spacer'}, { xtype: 'button', ui:'action', id: 'startRecording', text: 'Start Recording', listeners: { tap: function() { var pnl = Ext.getCmp('actionPanel'); // How do you access data from panel here?? } } }, {xtype: 'spacer'} ]}).showBy(recordingButton); },
-
25 Oct 2012 11:06 PM #4
It may be clearer if you could provide your panel code / definition as well... At least the part you want to access. Also which version of the SDK are you using?
-
28 Oct 2012 12:53 PM #5
Controller and panel code
Controller and panel code
Code:In Controller: showDetail: function(list, record) { this.showActionButton(); this.getMain().push({ xtype: 'recordingdetail', data: record.getData() }) In another file: Ext.define('MyRecording.view.RecordingDetail', { extend: 'Ext.Panel', xtype: 'recordingdetail', config: { title: 'Recording Detail', styleHtmlContent: true, scrollable: 'vertical', tpl: [ '<p>{recordingNo} {category} </p> <p>Recording started: {recDate}' ] } });
-
28 Oct 2012 12:55 PM #6
Sencha Touch Version
Sencha Touch Version
2.0.1.1


Reply With Quote