1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
    zozo4kin is on a distinguished road

      0  

    Default Unanswered: Problem with handling events in controller.

    Unanswered: Problem with handling events in controller.


    I have a problem with events. I have Ext.List. And I want listen a itemTap event in the Controller.
    config:{ refs:{ accountList:'#accountList',} control:{ accountList:{ itemtap:'onListTap'}}}, onListTap:function(view, index, target, record, e, eOpts){//something code},But it works only first(!) time. So i have a MainView and ListView. If i go to the ListView and tap on item it works great and open a new view. If you go back to ListView and tap again it works great. But if you go to the MainView and again to the ListView event handler doesn't works. Why?

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
    zozo4kin is on a distinguished road

      0  

    Default


    I have a problem with events. I have Ext.List. And I want listen a itemTap event in the Controller.
    Code:
    config:{   
        refs:{         
           accountList:'#accountList',}      
        control:{         
           accountList:{            
              itemtap:'onListTap'
           }
        }
    }, 
     onListTap:function(view, index, target, record, e, eOpts)
    {//something code},
    But it works only first(!) time. So i have a MainView and ListView. If i go to the ListView and tap on item it works great and open a new view. If you go back to ListView and tap again it works great. But if you go to the MainView and again to the ListView event handler doesn't works. Why?

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Renfrew
    Posts
    74
    Answers
    1
    Vote Rating
    2
    tmcdonald is on a distinguished road

      0  

    Default


    Is the view that you are opening with your ListView tap set to autoDestroy? If so try setting that to false and see what results you get.

  4. #4
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Answers
    29
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    As tmcdonald indicates, it sounds like your view is being destroyed at some point and then recreated. This is currently not supported but should be fixed in either 2.0.2 or 2.1.0.

    In general, it is far better to keep views that you've created as destroying and then recreating them can be an expensive process.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
    zozo4kin is on a distinguished road

      0  

    Default


    nothing changes =( Ed, maybe you can give me advice?

  6. #6
    Sencha User
    Join Date
    Nov 2011
    Location
    Renfrew
    Posts
    74
    Answers
    1
    Vote Rating
    2
    tmcdonald is on a distinguished road

      0  

    Default


    Could you supply some of your code for the listview and the container you are displaying?

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    17
    Vote Rating
    0
    zozo4kin is on a distinguished road

      0  

    Default


    Code:
    var accountsList = {
                xtype: 'list',    
                id: 'accountList',
                store: accountsStore,                        
                itemTpl: [
                    '<div class="v-my-account-title">{title}</div><div class="v-my-account-amount">{balance} р.</div>'
                ],
                listeners: {
                    itemtap: function(view, index, target, record, e, eOpts) {           
                        Ext.getCmp('navView').push({
                            xtype: 'accountItem',
                            title: record.get('title'),
                            record: record
                        });
                    }
                }
            }

    This code works fine! But if I try handle itemtap event in the controller, this method works also fine until I go to the main page and go back to listview. I hope I clearly explain problem.

  8. #8
    Sencha User
    Join Date
    Nov 2011
    Location
    Renfrew
    Posts
    74
    Answers
    1
    Vote Rating
    2
    tmcdonald is on a distinguished road

      0  

    Default


    What is the property of your navigation view's autoDestroy? You should set it to false:

    Code:
    Ext.define('MyApp.view.MyNavigationView', {
        extend: 'Ext.navigation.View',
        alias: 'widget.mainview',
    
        config: {
            id: 'mainview',
            autoDestroy: false,
            items: [
                {
                    xtype: 'container',
                    items: [
                        {
                            xtype: 'button',
                            docked: 'bottom',
                            id: 'buttonOne',
                            text: 'ListOne'
                        }
                    ]
                }
            ]
        }
    });

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar