Results 1 to 8 of 8

Thread: Store global load event in MVC

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User Arg0n's Avatar
    Join Date
    Apr 2012
    Vote Rating

    Default Answered: Store global load event in MVC

    I want to listen on load of all stores. Is there a way I can do it in a MVC structure? :x

    I already thought about extending from the '' class, but it wont work, because the class extinding it needs to be a store itself. So I read about the observable class, but this seems to be the wrong way too...
    I don't want to register a load listener for each store I have... I would lik eto have global load listener.

  2. I tested just now with the following and it worked for me (using ExtJS 4.1.1a - I think you need 4.1.1 or higher for Ext.application's init method to fire - was a bug fix)

    inside my Ext.application - moved setting up the global ( to the init function of Ext.application instead.
    init: function () {
        var me = this; = me;'add', function (i, store) {
            store.on('load', function () {        // or datachanged or whatever you want
      'storeload', store);
    Now from any controller you can add a listener for 'storeload'. The below snippet I put in one of my controller's init function
    me.application.on('storeload', function (store) { console.log(store); });
    That's how I saw ... I think Tommy Maintz ... can't remember ... fire and handle application level events and it's worked well for me.

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