Results 1 to 4 of 4

Thread: Dont fire "load" event

  1. #1

    Default Dont fire "load" event

    I try to subscribe on load event. This is part of my grid controller:

    Code:
    initComponent: function(){
            this.callParent();
            this.getStore().on('load', this.someMethod, this);
        },
    
    someMethod: function() {
            console.log('work!')
       },
    This is work for simple case.
    If i use bind on store like this:

    Code:
    bind: {
        store {
            fields:...,
            proxy:....,
            autoload: true,
            filters: {
                property: 'someProperty',
                value: '{grid.selection.name}',
            },
            remoteFilter: false
        }
    }
    my "someMethod" isnt work!
    What is the problem, where is "load" event?

  2. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    914
    Answers
    105

    Default

    I don't think you understand how bind config works. If you want a store for your component to be created from a config object, just assign that config object directly.

    More info about bind descriptors here.

  3. #3

    Default

    My grid is working. The problem not in binding.

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    914
    Answers
    105

    Default

    Ok, I made a simple fiddle to replicate what you are doing. You are right that trying to add the event listener by calling view.getStore().on(...) doesn't work in the init() method, but view.getViewModel().get('storeName').on(...) works. Most likely it's because at that point bindings have not been applied yet and calling view.getStore() returns the wrong store.

    The fiddle I made can be found here.

Similar Threads

  1. [6.0.2] TreeStore does not fire "add" event during load
    By yisohec in forum Ext JS 6.x Bugs
    Replies: 2
    Last Post: 17 Apr 2016, 9:07 PM
  2. Feature request: "Missing Store" > "Dont show again"
    By ssamayoa in forum Sencha Architect 2.x: Help & Discussions
    Replies: 4
    Last Post: 5 Jul 2012, 9:20 AM
  3. Fire a Tree "SelectionChange" event when clicking the currently selected item
    By Cputerace in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 27 Feb 2009, 8:59 AM
  4. [2.1][FIXED] Store.loadData does not fire "load" event
    By mcurrey in forum Ext 2.x: Bugs
    Replies: 4
    Last Post: 22 Jul 2008, 11:25 AM
  5. Ext.data.HttpProxy does not fire the "load" event.
    By Animal in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 12 Apr 2007, 4:00 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
  •