ExtJs4得知(五岁以下儿童)主要的Ext分类

Ext类是ExtJs最常见的、最基本的类,它是一个全局对象,它封装了全班、辛格尔顿和 Sencha 该方法提供了一种有用的库。


嵌套在该命名空间中一个较低的水平最用户界面组件。 但是提供了很多有用的功能作为通用 Ext 直接财产命名空间。


此外提供很多经常使用的方法,从其它类作为 Ext 命名空间内的快捷方式。

比如 Ext.getCmp 就是 Ext.ComponentManager.get 的别名。


一旦DOM准备好,很多应用程序启动,调用Ext.onReady。 这能够确保已载入全部脚本, 防止依赖性问题。比如:

Ext.onReady(function(){
    new Ext.Component({
        renderTo: document.body,
        html: 'DOM ready!'
    });
});

1 applyObject object, Object config, [Object defaults] ) : Object

參数是拷贝的源对象,第三个參数是可选的,表示给目标对象提供一个默认值。能够简单的理解成把第三个參数(假设有的话)及第二个參数中的属性拷贝给第一个參数对象。

var animal ={name:'tome'}
Ext.apply(animal,{
	age:12,
	run:function(){
		console.info('欢乐的跑着')
	}
});
终于animal对象也将拥有run方法,animal.run();


applyIfObject object, Object config ) : Object

和apply基本类似,唯一的差别是,假设object对象已经拥有某属性或方法,config不再进行覆盖


decodeString json, Boolean safe ) : Object

Ext.JSON.decode的简写形式 解码(解析)JSON字符串对象。

假设JSON是无效的,这个函数抛出一个SyntaxError。除非设置了安全选项。


var result = Ext.decode('{success:true,msg:xxxx}');
console.info(result.success)//true
Array/NodeList/Object iterable, Function fn, [Object scope], [Boolean reverse] ) : Boolean

Ext.each([1,2,3,4,5,6],function(item,index,allItems){
	if(item<5){
		return false;
	}else{
		console.log(item);
	}
});


5  flyString/HTMLElement dom, [String named] ) : Ext.dom.AbstractElement.Fly

getString/HTMLElement/Ext.Element el ) : Ext.dom.Element

getCmpString id )

getDomString/HTMLElement/Ext.Element el )

queryString path, [HTMLElement root], [String type] ) : HTMLElement[]

selectString selector ) : Ext.CompositeElement

以上在ExtJs4学习(二):Dom操作 已有介绍


Object target ) : Boolean

Object value ) : Boolean

Object object ) : Boolean

Object value ) : Boolean

Object value, Boolean allowEmptyString ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

Object value ) : Boolean

以上基本都是对象的推断,能够參考API


namespaceString... ) : Object

Ext.namespace('my.app.service');
my.app.service.name = 'somnus';
my.app.service.say = function(){console.info('hello')}
nsString... ) : Object

namespace的简写形式

Object target, Object overrides )

用给定的值重写指定target的成员。

var user = {
		age:20,
		say:function(){
			console.info("我的年龄:"+this.age)
		}
}
Ext.override(user,{
	say:function(){
		console.info("我的年龄:"+this.age+"岁")
	}
});
user.say();

10 [String name], [Object config] ) : Object

var button = Ext.widget('button'); // 相当于Ext.create('widget.button');

var panel = Ext.widget('panel', { // 相当于Ext.create('widget.panel')
    title: 'Panel'
});

var grid = Ext.widget({
    xtype: 'grid',
    ...
});

版权声明:本文博主原创文章,博客,未经同意不得转载。

posted @ 2015-09-22 21:15  zfyouxi  阅读(218)  评论(0编辑  收藏  举报