1. #1
    Ext JS Premium Member paubach's Avatar
    Join Date
    Jan 2008
    Location
    Plasencia, Spain
    Posts
    337
    Answers
    1
    Vote Rating
    0
    paubach is on a distinguished road

      0  

    Question Answered: Access data from children components.

    Answered: Access data from children components.


    Hi, I'm trying to follow the MVC architecture on my first application in Sencha Touch, but I'm a bit lost:

    In the code below I don't get the data sent by controller for the template, as it is in a component inside the main one.
    Code:
    Ext.define("profe.view.AlumnDetail", {    extend: 'Ext.Panel',
    	xtype: 'alumndetail',
    	id: 'alumnDetail',
        config:
    	{
    		fullscreen: true,
    		layout: 'vbox',
    		xtype: 'panel',
    		items:[			
    			{
    				xtype: 'panel',
    				tpl:'<div><div style="float:left;"><img src="http://www.sencha.com/assets/images/sencha-avatar-64x64.png" width="64"></div><div style="margin:0 0 0 80px;">{nombre} {apellido1} {apellido2}<br>Nacimiento: {nacimiento:date("d/m/Y")}<br> Telefono: {telefono}<br>Padres: {padres} <br> Repetidor: <tpl if="rep == true"> SI <tpl else> NO </tpl> <br>Pendientes: {pendientes}</div></div>'
    			},
    			{
    				xtype: 'alumndetailcalendario'
    			},
    			{
    				xtype: 'alumndetailnotas'
    			}
    		]
    	}
    });
    If I use the template on the main panel (and not on one children) it works perfectly.

    Data is sent in the controller:
    Code:
    Ext.define('profe.controller.SelectAlumn', {    extend: 'Ext.app.Controller',
        config: {
            refs: {
                main: 'mainpanel'
            },
            control: {
                'list': {
                    disclose: 'showDetail'
                }
            }
        },
    
    
        showDetail: function(list, record) {
    	   this.getMain().push({
                xtype: 'alumndetail',
                title: record.fullName(),
                record: record,
    			data: record.getData()
            });
        }
    
    
    });
    The question would be how to access the data from the children, should I send to it using the controller?

    What if I want to send data to the alumndetailcalendario and alumndetailnotas panels? Or what if I want to access new data from them?

    A link to an example would be great also, as I feel very lost and will have more questions for sure.

    Thanks,
    Pau
    -->

  2. I solved this using
    Code:
    initialize: function()	{
    		this.getComponent(0).setData(this.getData());
    	}
    (answering in case it can be a help for anybody)

  3. #2
    Ext JS Premium Member paubach's Avatar
    Join Date
    Jan 2008
    Location
    Plasencia, Spain
    Posts
    337
    Answers
    1
    Vote Rating
    0
    paubach is on a distinguished road

      0  

    Thumbs up


    I solved this using
    Code:
    initialize: function()	{
    		this.getComponent(0).setData(this.getData());
    	}
    (answering in case it can be a help for anybody)
    -->

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi