View Full Version : Best practices for begginers

19 Apr 2011, 1:04 PM
Hi everbody,

I'm a begginner with sencha touch and i'm trying to develop a MVC app.

My first question is about all the examples I've downloaded.
Sometime, people use this kind of code:

Ext.apply(app.views, {myView: new app.views.MyView()});and others use :

app.views.MyViews = Ext.extend(....
Ext.reg('MyView', app.views.MyView);
Same for the controllers. Is it better to use the full path (app.controllers.myControllers) or the Ext.dispatch method.

Can someone please explain me which of this solution is the best and why....

And second, is there any documentation about sencha's best pratice to develop with. ?

Thanks a lot !!


20 Apr 2011, 12:26 AM
i second that.
throughout all the examples and tutorials there are very different ways of instantiating components, registrate and then accessing them.
I ended up using Ext.regXYZ and Ext.getXYZ to instantiate, registrate and access my components while following the MVC structure. This seemed to me the most easy way, as i had a lot of "object unknown" problems using smth like
app.views.MyViews = Ext.extend(....

i found this post, asking a similar question:http://www.sencha.com/forum/showthread.php?125034-Sencha-MVC-components-Registering-vs.-Namespaces

can someone please explain the differences?

20 Apr 2011, 9:45 PM
I found this example http://senchatouchinaction.com/examples/chapter02

I think it's a good start... hope this help

21 Apr 2011, 2:31 AM
anybody from sencha support team ? dev team ??

22 Apr 2011, 4:54 AM
Well.. maybe you'll get a bit of support if you have a dev. license.
A catch 22 really because I have no idea about what is going on in the premium forum, there's relatively little posts made there, which either means few licenses sold or the Sencha team spends little time in there as well..

Pretty sad.. I've been using Ext/Sencha for a few years now and have always been very pleased with the support, but official/knowledgable support in the Touch forums is lacking seriously. A good reason to put off getting a license until things improve AFAIC.