码迷,mamicode.com
首页 > 其他好文 > 详细

sencha touch规范

时间:2016-09-15 08:40:35      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

少用全局变量,用config配置组件的参数,用于参数传递
 
controll中requires的别用,但有3个例外

As you add more classes to your application, these configurations become more and more useful in helping you avoid typing out the full class names for every file. Be aware, however, that three of those configurations do more than just load files–they also do the following:

  • profiles - Instantiates each Profile and determines if it should be active. If so, the Profile’s own dependencies are also loaded.
  • controllers - Instantiates each Controller after loading.
  • stores - Instantiates each Store, giving it a default store ID if one is not specified.

//creating a view - 2.x uses the standardized Ext.create
this.getLoginView().create();
Ext.create(‘MyApp.view.Login‘);

//getting a Model - just type out the Model name (it‘s shorter and faster)
this.getUserModel();
MyApp.model.User;

//Ext.getStore can access any Store whereas the old this.getStore only
//accessed those Stores listed in your Controller
this.getStore(‘Products‘);
Ext.getStore(‘Products‘);

//监听访问路径

  routes: {
            ‘login‘: ‘showLogin‘,
            ‘user/:id‘: ‘showUserById‘
        },

Before Filters

 

sencha touch规范

标签:

原文地址:http://www.cnblogs.com/dwyanezhou/p/5874269.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!