-
2 Feb 2012 2:32 AM #11
nice idea @philstrong. I would be nice to to have possibility to mark function to be called from init functions.
Wemerson Januario
Skype: wemerson.januario
Email: wemerson.januario@gmail.com
Fone: 62 84101145 - Goiânia-GO- Brazil
Consulting and Training Ext JS
Projects: (Nubes ERP)
-
3 Feb 2012 1:28 PM #12
Some thing like this?
For non visual:
For visual:Code:var me = this; cfg = cfg || {}; cfg = me.beforeConstructor(cfg); // If defined me.callParent([Ext.apply({}, cfg)]); me.afterConstructor(); // If defined
Code:var me = this; var args = arguments; args = beforeInitComponent(arguments); // If defined me.callParent(args); me.afterInitComponent(); // If defined
UI: Sencha Architect 2.x / ExtJS 4 MVC
Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
Application Server: Glassfish 3.1.x
Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5
If you like my answer please vote!
-
17 Feb 2012 6:12 PM #13
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?
-
17 Feb 2012 6:20 PM #14
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
-
17 Feb 2012 7:44 PM #15
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?
-
17 Feb 2012 8:03 PM #16
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
-
17 Feb 2012 8:12 PM #17
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
-
17 Feb 2012 9:24 PM #18
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.."
-
18 Feb 2012 11:29 AM #19
-
28 Feb 2012 11:31 PM #20
Aaron Conran
@aconran
Sencha Architect Development Team



Reply With Quote