1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    senchadriver is on a distinguished road

      0  

    Default 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>
    &nbsp;&nbsp;&nbsp;&nbsp;var actionButton = this.getActionButton();<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;var overlay = new Ext.Panel({<br>
    &nbsp;&nbsp;&nbsp;&nbsp;left: 0,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;modal: true,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;scroll: false,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;padding: 10,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;id:'actionPanel',<br>
    &nbsp;&nbsp;&nbsp;&nbsp;layout: {<br>
    &nbsp;&nbsp;&nbsp;&nbsp; type: 'vbox',<br>
    &nbsp;&nbsp;&nbsp;&nbsp; align:'center',<br>
    &nbsp;&nbsp;&nbsp;&nbsp; pack:'center'<br>
    &nbsp;&nbsp;&nbsp;&nbsp;},<br>
    &nbsp;&nbsp;&nbsp;&nbsp;items:[<br>
    &nbsp;&nbsp;&nbsp;&nbsp; {xtype: 'spacer'},<br>
    &nbsp;&nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp;&nbsp; xtype: 'button',<br>
    &nbsp;&nbsp;&nbsp;&nbsp; ui:'action',<br>
    &nbsp;&nbsp;&nbsp;&nbsp; id: 'startRecording',<br>
    &nbsp;&nbsp;&nbsp;&nbsp; text: 'Start Recording',<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listeners: {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tap: function() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pnl = Ext.getCmp('actionPanel');<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//**** I need to access panel data here<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
    &nbsp;&nbsp;&nbsp;&nbsp; },<br>
    &nbsp;&nbsp;&nbsp;&nbsp; {xtype: 'spacer'}<br>
    &nbsp;&nbsp;&nbsp;&nbsp;]}).showBy(actionButton);<br>
    },<br>
    <br>
    Any help appreciated.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,117
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    senchadriver is on a distinguished road

      0  

    Default 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);
    	
    },

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    591
    Vote Rating
    34
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    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?

  5. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    senchadriver is on a distinguished road

      0  

    Default 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}'
            ]
        }
    });

  6. #6
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    senchadriver is on a distinguished road

      0  

    Default Sencha Touch Version

    Sencha Touch Version


    2.0.1.1