1、Extjs4中up()和down()来获取组件的用法

http://www.mhzg.net/a/201111/201111181180445.html

 

2、可以在model里面做字段转换、字段校验、配置proxy等,可与其他Model进行关联。。下为字段校验:

  1. Ext.define('User', { 
  2.     extend: 'Ext.data.Model'
  3.     fields: [ 
  4.         {name: 'name',     type: 'string'}, 
  5.         {name: 'age',      type: 'int'}, 
  6.         {name: 'phone',    type: 'string'}, 
  7.         {name: 'gender',   type: 'string'}, 
  8.         {name: 'username', type: 'string'}, 
  9.         {name: 'alive',    type: 'boolean', defaultValue: true
  10.     ], 
  11.  
  12.     validations: [ 
  13.         {type: 'presence',  field: 'age'}, 
  14.         {type: 'length',    field: 'name',     min: 2}, 
  15.         {type: 'inclusion', field: 'gender',   list: ['Male''Female']}, 
  16.         {type: 'exclusion', field: 'username', list: ['Admin''Operator']}, 
  17.         {type: 'format',    field: 'username', matcher: /([a-z]+)[0-9]{2,3}/} 
  18.     ] 
  19. }); 

exclusion:验证给定的值配置列表

format:如果给定值通过配置匹配正则表达式验证,则返回true

inclusion:验证给定的值配置列表

length:如果给定值配置最小值和最大值之间返回true

presence:验证给定的值存在

 

3、comboBox,

forceSelection字段为true则只能选择,为false则可自由输入,默认为false。

 editable字段也可以实现相同效果。

 

4、this相当于java里面的public,var相当于private

 

5、ExtJS4的动态加载/异步加载很强大~  即Ext.Loader

 

6、*需要通过这种方式改变下弹出框的按钮文本……

  1. Ext.MessageBox.YES = "Yes" 
  2. Ext.MessageBox.NO = "No" 

 

7、Ext.application   这个东西有待了解和使用。

 

8、控制器controller层——目前项目中还没用到……

ExtJS4学习Tips_Tips

 

9、动态grid,需要后台数据支持。。。粗略有了思路,待详细考虑如何实现。。

 

10、Grid行多选/全选:

  1. selModel: Ext.create('Ext.selection.CheckboxModel',{}) 

 

11、带复选框的树:后台的json数据里设置"checked": true/false

 

12、图片上传 Ext.form.field.File   xtype: filefield, fileuploadfield

 

13、gridtree

 

14、grid 分组:

ExtJS4学习Tips_休闲_02 ExtJS4学习Tips_休闲_03

 

15、我还是想实现在gridpanel上进行增删改……

 

16、莫名奇妙的问题:gridpanel的column的很多字段都设了width属性后,页面加载会慢得崩溃。

 

17、类中自定义属性、方法。 我的思路总是扩展不开。

 

18、动态加载提高了初始化的速度。requires。需要时加载。

 

19、config为我们自动生成get、set方法。

我还以为api中的configs都可以get、set来获取呢……

 

20、 maixins为多继承。使一个类具有多个类的属性、方法。

 

21、插拔式开发。

 

22、数据模型:model/proxy/store

 

23、displayfield -》是个好东西

 

24、triggerfield —》添加地图坐标时用到

 

25、Ext.regModel创建model类,不需要extend:Ext.data.Model.

 

26、创建一个model类的对象,可通过new、Ext.create、Ext.ModelManager.create。

 

27、断点调试!可查看参数!