Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Brescia - Italy
    Posts
    102
    Vote Rating
    4
    tino7_03 is on a distinguished road

      0  

    Default Problem with this.control in controller

    Problem with this.control in controller


    Dear,
    I'm trying to create my first ST2 application after a good ST1 experience.
    This is a part of my app:

    controller/Main.js
    Code:
    Ext.define(
    'GpMobile.controller.Main', {
    
        extend: 
    'Ext.app.Controller',   
    
        views: [
    'Domain','Login'],
    
        stores: [
    'Settings'],
    
        config: {
    
            profile: Ext.os.deviceType.toLowerCase()
    
        },
    
        init: 
    function() {
    
            
    if(this.getSettingsStore().getCount()==0){
    
                Ext.Viewport.add({xtype: 
    'domainview'});
    
            }
    
            
    else{
    
                Ext.Viewport.add({xtype: 
    'loginview'});
    
            }
    
            
    this.control({
    
                
    'button[go]': {
    
                    tap: 
    function() {
    
                        Ext.Viewport.add({
    
                            xtype: 
    'loginview'
    
                        });
    
                    }
    
                }
    
            })
    
        
     
    
    });
    
    view/Domain.js

    Code:
    Ext.define(
    'GpMobile.view.Domain', {
    
    
        extend: 
    'Ext.Panel',
    
        alias:
    'widget.domainview',
    
        config: {
    
            fullscreen : 
    true,
    
            
    //itemId:"pippo",
    
            layout: {
    
                type: 
    'vbox',
    
                pack: 
    'top'
    
            },
    
            items: [
    
                        
    new Ext.NavigationBar({
    
                            dock : 
    'top',
    
                            ui:
    'dark',
    
                            title: gblAppName,
    
                            items: [
    
                                    {
    
                                            xtype: 
    "button",
    
                                            id:
    'btnDomainLogoff',
    
                                            name: 
    "btnDomainLogoff",
    
                                            ui : 
    "round",
    
                                            text: 
    "Logoff",
    
                                            align:
    'left'
    
                                        }
    
                                    ]
    
                        }),
    
                        
    new Ext.NavigationBar({
    
                            dock : 
    'top',
    
                            ui:
    'light',
    
                            title: 
    'Accesso ai dati',
    
                            items: [
    
                                {
    
                                        xtype: 
    "button",
    
                                        id:
    'btnDomainBack',
    
                                        name: 
    "btnDomainBack",
    
                                        ui : 
    "back",
    
                                        text: 
    "Indietro",
    
                                        align:
    'left'
    
                                    },
    
                                    {
    
                                        xtype: 
    "button",
    
                                        id:
    "btnDomainDone",
    
                                        name: 
    "btnDomainDone",
    
                                        ui : 
    "forward",
    
                                        text: 
    "Prosegui",
    
                                        align:
    'right',
    
                                        go: 
    'loginview'
    
                                    }
    
                            ]
    
                        }),
    
                    
    
                    {
    
                        xtype: 
    'container',
    
                        layout: {
    
                            type: 
    'vbox',
    
                            pack: 
    'center'
    
                        },
    
                        items:[
    
                                {
    
                                    xtype: 
    'fieldset',
    
                                    instructions: 
    "Specificare il dominio del server per l'accesso ai dati",
    
                                    items: [
    
                                            {
    
                                                xtype: 
    'textfield',
    
                                                name : 
    'txtDomain',
    
                                                label: 
    'Dominio',
    
                                                labelWidth:
    '10%',
    
                                                placeHolder: 
    "http://xxxxxxxxxxxx.xxx/"
    
                                            }
    
                                        ]
    
                                }
    
                               ]
    
                    }
    
                    
    
            ]
    
        }
    
        
    
    
     
    
    });
    
    App.js

    Code:
    Ext.Loader.setConfig({ enabled: 
    true});
    
    
    Ext.application({
    
        
    //phoneStartupScreen: 'images/sencha_logo.png',
    
        name: 
    'GpMobile',  
    
        controllers: [
    'Main'] ,
    
        
    //autoCreateViewport:true
    
    });
    


    From two days I try to understand why my "this.control" in main.js not fire when I press button in domain.js. Same problem if I put a "render" listener into it like this:

    Code:
    'domainview'
    : {
    
                    render: 
    function() {
    
                        alert(
    'f');
    
                    }
    
    Can you help me please?
    Thanks in advance.

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    Brescia - Italy
    Posts
    102
    Vote Rating
    4
    tino7_03 is on a distinguished road

      0  

    Default


    SOLVED!

    Code:
    init: 
    function() {
    
            
    if(this.getSettingsStore().getCount()==0){
    
                Ext.Viewport.setActiveItem({xtype: 
    'domainview'});
    
            }
    
            
    else{
    
                Ext.Viewport.setActiveItem({xtype: 
    'loginview'});
    
            }
    
            
    this.control({
    
                
    /*'#btnDomainDone[go]':{ // Intercetta gli eventi del pulsante btnDomainDone
    
                  tap:function(){
    
                      alert('o');
    
                  }  
    
                },*/
    
                
    'button[go]': { // Intercetta gli eventi di tutti i "button" con proprietà "go"
    
                    tap: 
    function(btn) {
    
                        Ext.Viewport.setActiveItem({xtype: btn.go});
    
                    }
    
                }
    
            })
    
        }