1. #11
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goias, Goiânia
    Posts
    433
    Vote Rating
    6
    wemerson.januario is on a distinguished road

      0  

    Default


    nice idea @philstrong. I would be nice to to have possibility to mark function to be called from init functions.
    Wemerson Januario
    Twitter:
    @wemersonjanuar
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 9106-6689
    From: Goiânia, Brazil
    Desenvolvedor ExtJS/ ExtJS Developer

  2. #12
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,266
    Vote Rating
    80
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Some thing like this?

    For non visual:

    Code:
    var me = this;
    cfg = cfg || {};
    cfg = me.beforeConstructor(cfg); // If defined
    me.callParent([Ext.apply({}, cfg)]);
    me.afterConstructor(); // If defined
    For visual:

    Code:
    var me = this;
    var args = arguments; 
    args = beforeInitComponent(arguments); // If defined
    me.callParent(args);
    me.afterInitComponent(); // If defined
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #13
    Touch Premium Member
    Join Date
    Feb 2012
    Posts
    10
    Vote Rating
    0
    delgrundy is on a distinguished road

      0  

    Default


    So would I be coming to the correct conclusion if I said that Designer is intended to discourage me from adding listeners willy nilly in my containers via the read-only restrictions in favor of Controller based stuff?

  4. #14
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    delgrundy -

    Its not as simple as that, both basic event bindings and controller actions have a time and a place. In general if behavior can be limited to be scoped within all of its child pieces and is not interacting with other components its better to be baked right in.

    If you are interacting with separate components then you should probably be using controller actions.

    There is no hard and fast rule but this could be used as a general guideline.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #15
    Touch Premium Member
    Join Date
    Feb 2012
    Posts
    10
    Vote Rating
    0
    delgrundy is on a distinguished road

      0  

    Default


    Fair enough. But I don't see where I have the freedom in an XDS project to just add a listener to a container as a configuration object. So am I to assume that what I am supposed to be doing if, for example, I want to support a tap event on a panel that I should add a Basic Event Binding to the component and then create a Basic Function that does the listener stuff to support it?

  6. #16
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    A basic event binding also consists of the function. So you just need to add the basic event binding, configure the event type/name and then go into code view and edit the source code for the event binding.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  7. #17
    Touch Premium Member
    Join Date
    Feb 2012
    Posts
    10
    Vote Rating
    0
    delgrundy is on a distinguished road

      0  

    Default


    ah ha! Ok so how do I specify the swipe, tap etc? I see the listener object configuration showing up in the panel config now as a result of having selected a name/event in the BEB, but that is based on all things except such things as tap, swipe etc. In this vid: http://docs.sencha.com/touch/2-0/#!/...o-to-listeners
    he shows three ways to add a listener and the addListener() function specifies tap, swipe and such. Since I am confined to the name/events offered by the BEB, where should the specification of the user touch events come into play?
    Last edited by delgrundy; 17 Feb 2012 at 8:24 PM. Reason: submitted prematurely

  8. #18
    Touch Premium Member
    Join Date
    Feb 2012
    Posts
    10
    Vote Rating
    0
    delgrundy is on a distinguished road

      0  

    Default


    I think I just answered my own question. As usual I am making something easy to be difficult. Rather than add a generic event binding, I just need to select the events directly from the container. Then all of the touch events are right there. Or I suppose I could have just said "Duh.."

  9. #19
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by delgrundy View Post
    I think I just answered my own question.
    Glad you figured it out. :-)
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  10. #20
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  
    Aaron Conran
    @aconran
    Sencha Architect Development Team