1. #1
    Sencha User
    Join Date
    Oct 2014
    Posts
    1
    Vote Rating
    0
    leosouzabh is on a distinguished road

      0  

    Default Button needs 2 clicks to execute after navigationview back

    Button needs 2 clicks to execute after navigationview back


    I hv a navigationview with one button and one form to input values, when i click on button, open my form. this form hv a button to cancel and back to main view.
    The question:
    - When i use my custom cancel button to navigation view backs normaly, but the next action in main view need 2 clicks to work, exemple, if a click on button to open the form again, it needs 2 click to work.
    - Otherwise if i use a default back button of the navigation bar all works fine.
    Why 2 clicks ?

    My MainView
    Code:
    Ext.define('MyApp.view.Home', {
        extend: 'Ext.navigation.View',
        xtype:'homeview',
        config: {
            navigationBar: {
                docked: 'top',
                items: [{
                    xtype: 'button', id: 'botaoAdicionar',
                    text: 'Add User', ui: 'action',
                    action: 'addUser'
                }]
            },
            items: [{
                title: 'SQlite DB',
                xtype: 'list',
                itemTpl: ['<div>leo</div>']            
            }]
        }
    });
    My Controller
    Code:
        Ext.define('MyApp.controller.MainController', {
            extend: 'Ext.app.Controller',
            config: {
                refs:{
                    homeview: 'homeview',
                    createTaskButton: '#botaoAdicionar',
                    botaoCancelar: 'button[action=cancelar]'
                },
                control: {
                    createTaskButton: {
                        tap: 'addUser'
                    },
                    botaoCancelar: {
                        tap: 'hidePopup'
                    }
                }
            },
            hidePopup: function(button, e, eOpts) {
                this.getHomeview().pop();        
                this.getHomeview().fireEvent('back', this.getHomeview());
            },
            addUser: function(button, e, eOpts) {
                this.getHomeview().push(Ext.create('MyApp.view.AddUser'));
            },
        });
    My Panel Form
    Code:
        Ext.define('MyApp.view.AddUser', {
            extend: 'Ext.Panel',  
            xtype:'addUser',
            id:'datepanel',
            config: {
                items : [             
                    {
                        docked: 'bottom',
                        xtype: 'toolbar',
                        items :[{
                            xtype: 'button',
                            ui: 'decline',
                            text: 'Cancel',
                            align : 'right',
                            action: 'cancelar'
                        }]
                    }
                ]
            }
        });
    Last edited by leosouzabh; 17 Oct 2014 at 8:43 AM. Reason: format code

Tags for this Thread