Results 1 to 2 of 2

Thread: Why is the listener not working?

  1. #1
    Sencha User
    Join Date
    Jul 2018
    Posts
    11

    Default Why is the listener not working?

    Why is the first listener not working and the other one working?
    How to set the first one to work?





    HTML Code:
    [QUOTE]Structure folders:
    
    
    //FeedViewer
        //app
            //view
               //main
                   /MainController.js
                   /MainModel.js
                   /FeedForm.js
                  /Feeds.js
        //classic
        //modern
            //src
                //view
                    //main
                        /Main.js
    
    
    MainController.js
    
    
    Ext.define('FeedViewer.view.main.MainController', {
        extend: 'Ext.app.ViewController',
        alias: 'controller.main',
    
    
         onNewFeed: function () {
            alert('Hello');
        }
    });
    
    
    
    
    Feeds.js
    
    
    Ext.define('FeedViewer.view.main.Feeds',{
        extend:'Ext.grid.Grid',
    
    
        xtype:'feedslist',
    
    
        requires:[
            'ContactsApp.view.feeds.MainController',
            'ContactsApp.view.feeds.MainModel'
    
    
        ],
    
    
        viewModel:'feeds',
        controller:'feeds',
    
    
    
    
        columns:[
            {
    
    
                dataIndex:'feed',
                text:'feed'
            }
    
    
        ],
    
    
        items:[
            {
                xtype:'toolbar',
                docked:'left',
                items:[
                    {   
                        xtype:'button'
                        text:'Add New Feed',
                        iconCls:'fa fa-plus',
                        listeners:{
                            click:'onNewFeed'   //It doesn't work
    
    
                        }
    
    
                    }
                ]
            }
        ],
        listeners:{
                select :'onNewFeed'   //It  works
    
    
          }
    });
    [/QUOTE]

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    Default

    If this is modern toolkit, instead of click, use the tap event.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

Similar Threads

  1. Form listener not working
    By austin1030 in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 26 Nov 2013, 3:21 PM
  2. [FIXED] listener not working on a ToolBar
    By chris_nl in forum Sencha Touch 2.x: Bugs
    Replies: 2
    Last Post: 22 Jan 2012, 5:18 PM
  3. Listener Not Working
    By Hook in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 May 2011, 9:57 AM
  4. AreaChart Listener not working?
    By cnestor in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 17 Nov 2009, 7:46 AM
  5. HtmlEditor listener not working
    By lumulumu in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 24 Jan 2008, 1:11 PM

Tags for this Thread

Posting Permissions

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