Extjs 学习笔记
2014-08-29 00:00
197 查看
摘要: Extjs 学习笔记
学习和使用Extjs已经有一段时间了,之间遇到了一些问题,并解决了,故作此文已记之。
1.如果window没有显示,可能是因为没有设置window的width height x y
2.如果某一个容器没有显示,可能是因为width和height设置的不对,(比如其他容器太大了,被覆盖了)
3.容器可以用collapsible:true,来显示收缩/展开按钮
4.用textfield中的value属性,可以给其设置默认值。
5.renderer主要使用与 gridpanel中的某一列,显示与值相对应的含义。例如值为false,
用
6.滚动显示信息
7.Extjs 中的isKindOf
这里我们先回顾一下Java的isKindOf和isMemberOf。
isKindOf:class 表示:对象是否为class或其父类
isMemberOf:class 表示:对象是否为class
在Extjs中,我暂时只找到了isKindOf的判断方法:isXType
学习和使用Extjs已经有一段时间了,之间遇到了一些问题,并解决了,故作此文已记之。
1.如果window没有显示,可能是因为没有设置window的width height x y
2.如果某一个容器没有显示,可能是因为width和height设置的不对,(比如其他容器太大了,被覆盖了)
3.容器可以用collapsible:true,来显示收缩/展开按钮
4.用textfield中的value属性,可以给其设置默认值。
5.renderer主要使用与 gridpanel中的某一列,显示与值相对应的含义。例如值为false,
用
renderer: function(value){ if(value=='1'){ return '男'; }else if(value=='2'){ return '女'; }else{ return '未知'; } }
6.滚动显示信息
region:'south', xtype:'label', style: 'font-size:18px;font-family: 隶书;color:red;text-align:center;', height: 18, name:'status', animate:true, listeners:{ render:function(){ count=0; var task = { run:function(){ var message=['青岛黄岛暴雨预警','市南区山东路发生重大交通事故','崂山区世园会附近发生严重拥堵']; count=count+1; if(count>=3) count= count%3; Ext.ComponentQuery.query('monMain label[name=status]')[0].setText(message[count]); }, interval:3000, animate:true }; var runner = new Ext.util.TaskRunner(); runner.start(task); } }
7.Extjs 中的isKindOf
这里我们先回顾一下Java的isKindOf和isMemberOf。
isKindOf:class 表示:对象是否为class或其父类
isMemberOf:class 表示:对象是否为class
class Person{ } class Employee extends Person{ } public void testApp() { Person p = new Person(); Employee e = new Employee(); System.out.println(e instanceof Employee);// isKindOf true System.out.println(p.getClass().getName(). equals(e.getClass().getName()));//isMemberOf false }
在Extjs中,我暂时只找到了isKindOf的判断方法:isXType
var tabView = Ext.ComponentQuery.query(view)[0]; if(tabView.isXType('gridpanel')){ tabView.getStore().load(); }
相关文章推荐
- extJs 2.1学习笔记(Ext.Updater篇一)
- extJs 2.0学习笔记
- ExtJs学习笔记(2)_Basic GridPanel[基本网格]
- ExtJs学习笔记(8)_TabPanel的用法
- ExtJs学习笔记(4)_EditorGridPanel(可编辑的网格控件)
- ExtJs学习笔记(4)_EditorGridPanel(可编辑的网格控件)
- eXTJS学习笔记
- ExtJs学习笔记(1)_Hello World!
- ExtJs组件学习笔记
- extjs学习笔记--- 实战
- extJs 2.1学习笔记(Ext.data.Connection篇二)
- extJs 2.1 学习笔记(Ext.data.HttpProxy篇)
- extJs 2.1学习笔记(Ext.Updater篇二)
- ExtJs学习笔记(2)_Basic GridPanel[基本网格]
- extJs 2.1学习笔记(Function扩展篇)
- extJs 2.1学习笔记(JSON序列化篇)
- extJs 2.1学习笔记(Ext.data.JsonReader篇一)
- Extjs学习笔记(-):ComboBox联动(下)
- ExtJs学习笔记(10)_Window窗口的Border布局
- ExtJs学习笔记(3)_GridPanel[XML做数据源]