1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    41
    Answers
    3
    Vote Rating
    0
    celwell is on a distinguished road

      0  

    Default Answered: Fire Event from Store and receive in List view

    Answered: Fire Event from Store and receive in List view


    How do I get that alert to fire in the List view upon store loading?

    Coffeescript:

    List:
    Code:
    Ext.define 'WSI.view.EventsList',
      extend: 'Ext.List'
      xtype: 'eventslist'
      config:
        listeners:
          showLoading: ->
            alert 'showLoading in EventsList heard'
            @fireEvent 'showLoading', 0
    Store:
    Code:
    Ext.define 'WSI.store.Events',
      extend: 'Ext.data.Store'
      xtype: 'eventsstore'
      config:
        model: 'WSI.model.Event'
        autoLoad: false
        pageSize: 15
        listeners:
          beforeload: ->
            @fireEvent 'showLoading', 0
          load: ->
            @fireEvent 'hideLoading', 0

  2. You would have to fire the event on the store and then add a listener within the list to listen to it:

    Code:
    Ext.define('MyList', {
        extend : 'Ext.dataview.List',
        xtype  : 'my-list',
    
        //...
    
        updateStore: function(newStore, oldStore) {
            if (oldStore) {
                oldStore.un('storeLoading', 'onStoreLoading', this);
            }
    
            if (newStore) {
                newStore.on('storeLoading', 'onStoreLoading', this);
            }
        },
    
        onStoreLoading : function() {
            //....
        }
    });
    Man, IMO Coffeescript is ugly

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,677
    Answers
    3355
    Vote Rating
    749
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You would have to fire the event on the store and then add a listener within the list to listen to it:

    Code:
    Ext.define('MyList', {
        extend : 'Ext.dataview.List',
        xtype  : 'my-list',
    
        //...
    
        updateStore: function(newStore, oldStore) {
            if (oldStore) {
                oldStore.un('storeLoading', 'onStoreLoading', this);
            }
    
            if (newStore) {
                newStore.on('storeLoading', 'onStoreLoading', this);
            }
        },
    
        onStoreLoading : function() {
            //....
        }
    });
    Man, IMO Coffeescript is ugly
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    41
    Answers
    3
    Vote Rating
    0
    celwell is on a distinguished road

      0  

    Default


    Thanks!

    Funny, I thought coffeescript looked so nice and it saves so many commas when using Sencha Touch. It can be cluttered though because if you space it out too much then it can get confusing.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar