1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default Ext.app.domain.Sprite missing?

    Ext.app.domain.Sprite missing?


    As much as I understand 4.2 Event Domains, I believe the Ext.app.domain.Sprite event domain is missing, 4.2 controllers still can't listen to sprite events.

  2. #2
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    Also, it appears that the Ext.app.domain.Direct dependency is missing in the Controller class.

    http://docs.sencha.com/extjs/4.2.0/s...app-Controller
    Last edited by LesJ; 17 Apr 2013 at 8:37 AM. Reason: Provide source link

  3. #3
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    Why Ext.app.EventBus requires Ext.app.domain.Component?

    http://docs.sencha.com/extjs/4.2.0/s...t-app-EventBus

    I don't see that the component event domain is being used. If it's needed, then why the remaining event domains are not required?

    I hope someone can answer these question. The Sprite event domain appears to be missing. The Direct domain dependency is skipped (is it functional?)

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,561
    Vote Rating
    203
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    There's not a domain.Sprite in 4.2, but there is domain.Direct.
    http://docs.sencha.com/extjs/4.2.0/#....domain.Direct

  5. #5
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    205
    Vote Rating
    40
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    LesJ,

    Direct domain is required by Ext.direct.Manager and it is functional. Not every application uses Ext.Direct so that domain is optional. Component domain is what was "control" event handling in 4.1- era; it is used by all MVC applications, that's why it is included by default.

    As for Sprite domain, thanks for suggestion. I'll enter a ticket for that, hopefully I'll have time to stuff it into 4.2.1.

    Regards,
    Alex.

  6. #6
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    One more app event domain is missing, and this is something I could use

    I'd add the Ext.app.domain.Router. This could work along the lines of the Backbone.Router

    More examples of routing from different libraries:
    Ember.js
    AngularJS

    E
    xt JS currently doesn't implement the concept of routes and routing.
    Last edited by LesJ; 9 May 2013 at 7:19 AM. Reason: Add more example from different libs

  7. #7
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      1  

    Default


    Another issue(?)

    Ext.chart.series.Series is an event source (domain), but there's no way to listen to chart series' events in the controller since series is not a component.

    Perhaps there should be a class event domain which would allow to listen to events fired by class instances.

  8. #8
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    205
    Vote Rating
    40
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Routing is not a simple thing to do in Ext JS, considering the complexity of the framework and applications built in it. Creating event domain for route events is just small piece of it, and is not a problem really. I don't think Routing domain will appear any sooner than core routing support is in place, if ever.

    As for Series events, you can create a custom domain for them quite easily. Take a look at how other domains work.

    Regards,
    Alex.

  9. #9
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    Looks like creating a custom event domain is quite simple, but the process may become tedious.

    For example, if I wanted to listen (in the controller) to CompositeSprite events... I couldn't do it w/o a custom event domain.

  10. #10
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,350
    Vote Rating
    134
    LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all LesJ is a name known to all

      0  

    Default


    In case some is following this thread, I created a custom event domain: PivotGrid.domain.Series so I could listen to Series events in a controller.

    My application is called PivotGrid, hence the PivotGrid prefix. Since I'd like to listen to events from selected series, I also added the seriesId config to each series.

    Here's the working code including the custom event domain and a controller using this domain.

    Code:
    Ext.define('PivotGrid.domain.Series', {
        extend: 'Ext.app.EventDomain',
        singleton: true,
        requires: [
            'Ext.chart.series.Series'
        ],
        type: 'series',
        idProperty: 'seriesId',
        constructor: function() {
            var me = this;
            me.callParent();
            me.monitor(Ext.chart.series.Series);
        }
    });
    
    Ext.define('PivotGrid.controller.Series', {
        extend: 'Ext.app.Controller',
        requires: [
            'PivotGrid.domain.Series'
        ],
        init: function () {
            var me = this;
            me.listen({          
                series: {
                    '#columns': {
                        itemclick: me.onItemClick,
                        itemmousedown: me.onItemMouseDown,
                    }
                }
            });
        },
        onItemClick: function (arg1, arg2) {
            //<debug>
            console.log(arg1);
            //</debug>
        },
        onItemMouseDown: function (arg1, arg2) {
            //<debug>
            console.log(arg1);
            //</debug>
        }
    });

Thread Participants: 2