Results 1 to 4 of 4

Thread: Adding store 'load' event to view controller isn't working

  1. #1
    Sencha Premium User
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    1,353

    Question Adding store 'load' event to view controller isn't working

    I have a form (with a VM and VC, created by Architect for me). I go to add a 'load' View Controller Event Binding on a store, save and reload the project, and I get this:

    Code:
    [E] Ext.util.Event.getFireInfo(): No method named "onJsonstoreLoad" on App.view.MyForm
    I've done this exact same step on other forms in my project, and those listeners all seem to work just fine. If I look at the VC code I can see that there is an onJsonstoreLoad function where it should be. It makes no sense.

    The store works fine, too. I have noticed that if I use a binding in my store proxy URL or extraParams and that value doesn't exist, then the store just won't exist, but there are no bindings here.

  2. #2
    Sencha Premium User
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    1,353

    Default

    I have another store in the same VM so I thought I'd see what it thought of a 'load' event listener on that one, and it works just fine! Here's my stores config:

    Code:
    stores: {
        MyWhateverStore: {
            remoteSort: true,
            model: 'App.model.Whatever',
            proxy: {
                type: 'ajax',
                simpleSortMode: true,
                url: '../Service/Whatever/',
                reader: {
                    type: 'json',
                    rootProperty: 'data'
                }
            },
            sorters: {
                direction: 'DESC',
                property: 'StartDate'
            },
            listeners: {
                load: 'onJsonstoreLoad1'
            }
        },
        PeopleStore: {
            model: 'App.model.Person',
            proxy: {
                type: 'ajax',
                url: '/Org/Service/People/',
                reader: {
                    type: 'json',
                    rootProperty: 'data'
                }
            },
            listeners: {
                load: 'onJsonstoreLoad'
            }
        }
    }
    the VC has both methods, too:

    Code:
    Ext.define('App.view.MyFormViewController', {
        extend: 'Ext.app.ViewController',
        alias: 'controller.myform',
    
        onJsonstoreLoad1: function(store, records, successful, eOpts) {
            // this doesn't work
        },
    
        onJsonstoreLoad: function(store, records, successful, eOpts) {
            // this works
        }
    
    });
    It just does not make sense!

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    117

    Default

    I have a similiar issue in sencha architect 3.5.1 where my store's load event is not getting triggered if it is in view controller. How are we to handle this ?

  4. #4
    Sencha Premium User
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    1,353

    Default

    I'm not sure anybody believes me really, and it's not the sort of thing you can isolate into a Fiddle, so whenever it decides to be difficult, I just use Process Config to add a listener that way. At least it works and gets me over the hurdle.

Similar Threads

  1. [OPEN] No load event for controller listen config on store.load
    By izorg in forum Ext 5: Bugs
    Replies: 2
    Last Post: 23 Aug 2014, 10:11 AM
  2. Replies: 1
    Last Post: 14 Mar 2013, 5:36 PM
  3. Adding controller, model; store and view dynamically
    By ALWA in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 30 Apr 2012, 3:59 AM
  4. On Ext.app.Controller store.load(...) function not working
    By todos27 in forum Sencha Touch 2.x: Q&A
    Replies: 5
    Last Post: 11 Mar 2012, 2:19 PM
  5. Load Store from Controller to XTemplate in View
    By qlpage in forum Ext: Discussion
    Replies: 0
    Last Post: 1 Jul 2011, 5:47 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
  •