Results 1 to 2 of 2

Thread: Adding event listeners to containers

  1. #1

    Default Adding event listeners to containers

    Hey all,

    I'm looking to add a function inside of a controller that does something each time a container is activated in my Sencha Architect (mobile) application. I currently have a function that looks like this:

    PHP Code:
    onContainerActivate1: function(newActiveItemcontaineroldActiveItemeOpts) {
        
    console.log("Activated!");

    It has a targetType of Ext.Container, and a control query of container.

    This function fires each time a container is activated, however many of my views have containers inside of containers, causing this function to fire multiple times. How can I change this function to listen to the event where only the top or outermost container is activated? Can we attach listeners to Ext.Viewport?

  2. #2
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi Wesley--

    Can you simply make a custom container class that you can use as needed and then add listeners for that specific class?

    Thanks!
    Joel

Similar Threads

  1. adding event listeners for phonegap events....
    By maddhippy in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 27 Apr 2013, 5:32 AM
  2. [HOWTO] Adding Event Listeners to Component Elements
    By Jacky Nguyen in forum Sencha Touch 2.x: Discussion
    Replies: 0
    Last Post: 22 Jan 2012, 4:36 PM
  3. Ext.Event static listeners[] slows down listeners removal
    By gbulfon in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 31 Aug 2009, 7:51 AM
  4. Adding buttons to a DataListItem, event listeners don't run
    By cravemusic in forum Sencha GXT Q&A
    Replies: 4
    Last Post: 11 Jun 2009, 9:55 AM
  5. [2.1] ScriptTagProxy not adding event listeners
    By dcopi in forum Ext 2.x: Bugs
    Replies: 5
    Last Post: 25 Jun 2008, 5:41 AM

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
  •