Results 1 to 2 of 2

Thread: [Modern] Navigation view - popping view fires the popped views show event.

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    74
    Answers
    1

    Default [Modern] Navigation view - popping view fires the popped views show event.

    Hey there, I'm in the process of transitioning a ST 2.4.1 app to ExtJS 6.

    When I press the back button in the NavigationView the view being popped fires its show event. Off the top of my head this doesn't make a whole lot of sense, am I misunderstanding something here?

    I tried making a fresh app with only a navigation view and pushing a tabpanel. And even there, when I pop a view off the navigation view the popped view fires it's show event.

    I haven't been able to get the same error in Sencha Fiddle, only on my local machine.

    Using
    Sencha Cmd 6.0.1.76
    Ext JS 6 6.0.1.250

    I put the listener functions directly on the view just so I didn't have to put the ViewControllers in here as well, the result is the same.

    My navigation view:
    Code:
    Ext.define("Playground.view.NavigationView", {
        extend: "Ext.navigation.View",
    
    
        requires: [
            "Playground.view.NavigationViewController",
            "Playground.view.NavigationViewModel"
        ],
    
    
        controller: "navigationview",
        viewModel: {
            type: "navigationview"
        },
    
    
        items: [{
            xtype: 'container',
            title: 'Initial view',
            items: [{
                xtype: 'button',
                text: 'Press me!',
                listeners: {
                    tap: 'onTap'
                }
            }]
        }],
    
    
        listeners: {
            initialize: function(nav) {
                this.onBefore('pop', function(nav, view) {
                    console.log(this.$className + '::beforePop');
                });
            },
            pop: function (navigationview, view, eOpts) {
                console.log(this.$className + '::onPop', navigationview, view, eOpts);
            }
        }
    });
    My TabPanel:
    Code:
    Ext.define("Playground.view.TabPanel",{
        extend: "Ext.tab.Panel",
        alias: 'widget.mytabpanel',
    
    
        requires: [
            "Playground.view.TabPanelController",
            "Playground.view.TabPanelModel"
        ],
    
    
        controller: "tabpanel",
        viewModel: {
            type: "tabpanel"
        },
    
    
        items: [{
            xtype: 'container',
            title: 'Tab 1',
            html: 'Tab 1'
        }, {
            xtype: 'container',
            title: 'Tab 2',
            html: 'Tab 2'
        }],
    
    
        listeners: {
            show: function (tabpanel, eOpts) {
                console.log(this.$className + '::onShow', arguments);
            }
        }
    });
    From console.log this is what I get when pushing the "Press me" button and then the back button:
    Code:
    >>> push "Press me!"
    Playground.view.TabPanel::onShow
    <<< push Back button in navigation view
    Playground.view.TabPanel::onShow
    Playground.view.NavigationView::beforePop
    Playground.view.NavigationView::onPop

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    Hi msweltzdk,

    Hopefully you've been able to get this working, if not were you able to get it to reproduce in a fiddle?


    Regards,
    Bryan

Similar Threads

  1. [OPEN] Event 'show' fires twice on item of Navigation.View
    By kurtov in forum Ext JS 6.x Bugs
    Replies: 1
    Last Post: 15 Jul 2015, 9:03 AM
  2. Replies: 1
    Last Post: 26 Nov 2012, 7:39 PM
  3. Replies: 1
    Last Post: 7 Jun 2012, 5:23 AM
  4. [WISH][GRANTED] Ext.navigation.View pop event passed all popped views
    By estesbubba in forum Sencha Touch 2.x: Bugs
    Replies: 3
    Last Post: 7 Feb 2012, 2:20 PM
  5. [CLOSED] [PR4] NavigationView pop event parameter 'view' is not the popped view
    By slrobertson1 in forum Sencha Touch 2.x: Bugs
    Replies: 1
    Last Post: 26 Jan 2012, 9:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •