Results 1 to 5 of 5

Thread: Cascading listener events

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Hamburg, Germany
    Posts
    97

    Default Cascading listener events

    Hi all,

    I need some kind of access to an underlying event. In my case I'm populating a combo box with json data, so the JsonStore fires a load event when all data loaded. Now I need any access to this event within my combo itself to set one of the options automatically. How does this work in practice? How to access a JsonStore event within a ComboBox listener?
    Cheerio,

    Chris

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You need to hook up your own listener to the store in one of the combobox events ('render'?).

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Hamburg, Germany
    Posts
    97

    Default

    Hi Condor,

    you mean not to define a listener within the store itself but reference the store's load event in combobox' listener? didnt find any doc about such listener cascades.
    Cheerio,

    Chris

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    The store load event is already hooked up by ComboBox to the onLoad method, so you could also use:
    Code:
    var combo = new Ext.form.ComboBox({
      ...
      onLoad: function(){
        // your code here
        this.constructor.prototype.onLoad.apply(this, arguments);
      }
    });

  5. #5
    Sencha User
    Join Date
    May 2010
    Location
    Hamburg, Germany
    Posts
    97

    Default

    Sorry Condor for these newbie questions but how to reference the store's load event within onLoad? when does onLoad fire exactely? a simple onLoad: function() {console.log("foo")} shows me it reacts on combo clicks but how should the simple console.log be defined to show the message after the combo is populated?
    Cheerio,

    Chris

Similar Threads

  1. List of Listener Events
    By Preston85 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 8 Jan 2010, 2:14 AM
  2. [SOLVED] Cascading combo boxes not cascading... yet... in CakePHP!
    By frederickd in forum Ext 3.x: Help & Discussion
    Replies: 26
    Last Post: 15 Nov 2009, 5:25 PM
  3. 2 events in a listener
    By ruchika in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 15 Oct 2009, 8:34 AM
  4. Cascading activate/deactivate events to child ContentPanels
    By kalebwalton in forum Community Discussion
    Replies: 2
    Last Post: 28 May 2008, 2:15 AM
  5. [2.0.2] FormPanel listener and events
    By mgallinucci in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 15 Apr 2008, 5:04 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
  •