spket插件,用于EXT开发
一、入门:
1.javascript设计模式 : 征服ajax2.0开发技术详解
2.
Ext.onReady();
对数组进行遍历:
ext.every(array,function(){},scope); //返回boolean类型值
Ext.fifter(array,function(){},scope); //返回符合的条件项
3.需引入:
<link rel="stylesheet" type="text/css" href="extjs4/resources/css/ext-all.css"/>
<script type="text/javascript" src="extjs4/bootstrap.js"/>
<script type="text/javascript" src="helloWorld.js[js文件]"/>
4.js声明对象和类:
函数对象中声明的变量 var a= "qq"; //相当于java中的private变量
通过 this.getA = function(){
return a;
}
获得。 //相当于java中的get、set方法
普通对象中声明的变量
5.EXTjs声明Windows
传统方式:
new EXT.window.Window({
//窗口的设置
width:100;
});
//常用方法:
get() //获得页面元素[…………选择器]
create(创建实体类名[EXT.window.Window],参数) //创建页面元素
Ext.create('Ext.window.Window', {
title: 'Hello',
height: 200,
width: 400,
layout: 'fit',
items: { // Let's put an empty grid in just to illustrate fit layout
xtype: 'grid',
border: false,
columns: [{header: 'World'}], // One header just for show. There's no data,
store: Ext.create('Ext.data.ArrayStore', {}) // A dummy empty data store
}
}).show();
函数对象的为内部函数取别名:
自定义组件
EXT.define("定义类名",参数【 xtype: 'grid',
border: false,
columns: [{header: 'World'}],
】);
Ext.Function . alias(类名【上部定义的定义类名】,"所取别名");
EXT.define("MyWin",{
extend : 'EXT.window.Window',
width : 400,
height : 300,
newTitle: "name2",
mySetTile : function (){
this.title = this.newTile;
},
title : 'name1',
initComponent: function(){
this.mySiteTitle();
this.callParent(arguments);
}
});
EXT.create("MyWin",{
Requires : “ex.MyWin” //将类在预加载中现引入
title : "MyWin"
}).show();
6.Ext.get(“myButton”).on(“click”,function(){
//点击页面元素时的执行函数体
});
7.Config //自动get和set
8.Mixins //将一个类定义好的类,混合到另一个定义中的类中【跟多继承相似】、
例:(调用子类时,即可实现多个父类的方法)
Minins :’MyWin【需要混合进来的函数别名】’;
Minins :{MyWin : ’MyWin’,
MyWin1 : ‘MyWin1’
};
9.Requires //
10.Statics //