/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2016 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial
Software License Agreement provided with the Software or, alternatively, in accordance with the
terms contained in a written agreement between you and Sencha.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2016-10-05 03:40:31 (283b2cb229d1bac39381235a0217583b24341c69)
*/
/**
* An abstract base class which provides shared methods for Components across the Sencha product line.
*
* Please refer to sub class's documentation.
* @private
*/
Ext.define('Ext.AbstractComponent', {
/* Begin Definitions */
requires: [
'Ext.ComponentQuery',
'Ext.ComponentManager',
'Ext.util.ProtoElement',
'Ext.dom.CompositeElement',
'Ext.PluginManager'
],
mixins: {
positionable: 'Ext.util.Positionable',
observable: 'Ext.util.Observable',
animate: 'Ext.util.Animate',
elementCt: 'Ext.util.ElementContainer',
renderable: 'Ext.util.Renderable',
state: 'Ext.state.Stateful'
},
// The "uses" property specifies class which are used in an instantiated AbstractComponent.
// They do *not* have to be loaded before this class may be defined - that is what "requires" is for.
uses: [
'Ext.PluginManager',
'Ext.Element',
'Ext.DomHelper',
'Ext.XTemplate',
'Ext.ComponentLoader',
'Ext.EventManager',
'Ext.layout.Context',
'Ext.layout.Layout',
'Ext.layout.component.Auto',
'Ext.LoadMask',
'Ext.ZIndexManager'
],
statics: {
AUTO_ID: 1000,
pendingLayouts: null,
layoutSuspendCount: 0,
/**
* Cancels layout of a component.
* @param {Ext.Component} comp
*/
cancelLayout: function(comp, isDestroying) {
var context = this.runningLayoutContext || this.pendingLayouts;
if (context) {
context.cancelComponent(comp, false, isDestroying);
}
},
/**
* Walk the DOM tree upwards and find the Component these elements belong to.
* @private
*/
findComponentByElement: function(node) {
var topmost = document.body,
target = node,
cmp;
while (target && target.nodeType === 1 && target !== topmost) {
cmp = Ext.getCmp(target.id);
if (cmp) {
return cmp;
}
target = target.parentNode;
}
return null;
},
/**
* Find a Component that the given Element belongs to.
*
* @param {Ext.dom.Element/HTMLElement} el
* @return {Ext.Component/null} Component, or null
* @private
*/
getComponentByElement: function(el) {
var cmpIdAttr = Ext.Component.componentIdAttribute,
cmpId;
el = Ext.fly(el);
if (!el) {
return null;
}
cmpId = el.getAttribute(cmpIdAttr);
if (cmpId) {
return Ext.getCmp(cmpId);
}
else {
return Ext.Component.findComponentByElement(el.dom);
}
},
/**
* Performs all pending layouts that were scheduled while
* {@link Ext.AbstractComponent#suspendLayouts suspendLayouts} was in effect.
* @static
*/
flushLayouts: function () {
var me = this,
context = me.pendingLayouts;
if (context && context.invalidQueue.length) {
me.pendingLayouts = null;
me.runningLayoutContext = context;
Ext.override(context, {
runComplete: function () {
// we need to release the layout queue before running any of the
// finishedLayout calls because they call afterComponentLayout
// which can re-enter by calling doLayout/doComponentLayout.
me.runningLayoutContext = null;
var result = this.callParent(); // not "me" here!
if (Ext.globalEvents.hasListeners.afterlayout) {
Ext.globalEvents.fireEvent('afterlayout');
}
return result;
}
});
context.run();
}
},
/**
* Resumes layout activity in the whole framework.
*
* {@link Ext#suspendLayouts} is alias of {@link Ext.AbstractComponent#suspendLayouts}.
*
* @param {Boolean} [flush=false] `true` to perform all the pending layouts. This can also be
* achieved by calling {@link Ext.AbstractComponent#flushLayouts flushLayouts} directly.
* @static
*/
resumeLayouts: function (flush) {
if (this.layoutSuspendCount && ! --this.layoutSuspendCount) {
if (flush) {
this.flushLayouts();
}
if (Ext.globalEvents.hasListeners.resumelayouts) {
Ext.globalEvents.fireEvent('resumelayouts');
}
}
},
/**
* Stops layouts from happening in the whole framework.
*
* It's useful to suspend the layout activity while updating multiple components and
* containers:
*
* Ext.suspendLayouts();
* // batch of updates...
* Ext.resumeLayouts(true);
*
* {@link Ext#suspendLayouts} is alias of {@link Ext.AbstractComponent#suspendLayouts}.
*
* See also {@link Ext#batchLayouts} for more abstract way of doing this.
*
* @static
*/
suspendLayouts: function () {
++this.layoutSuspendCount;
},
/**
* Updates layout of a component.
*
* @param {Ext.Component} comp The component to update.
* @param {Boolean} [defer=false] `true` to just queue the layout if this component.
* @static
*/
updateLayout: function (comp, defer) {
var me = this,
running = me.runningLayoutContext,
pending;
if (running) {
running.queueInvalidate(comp);
} else {
pending = me.pendingLayouts || (me.pendingLayouts = new Ext.layout.Context());
pending.queueInvalidate(comp);
if (!defer && !me.layoutSuspendCount && !comp.isLayoutSuspended()) {
me.flushLayouts();
}
}
}
},
/* End Definitions */
/**
* @property {Boolean} isComponent
* `true` in this class to identify an object as an instantiated Component, or subclass thereof.
*/
isComponent: true,
/**
* @private
*/
getAutoId: function() {
this.autoGenId = true;
return ++Ext.AbstractComponent.AUTO_ID;
},
deferLayouts: false,
/**
* @cfg {String} id
* The **unique id of this component instance.**
*
* It should not be necessary to use this configuration except for singleton objects in your application. Components
* created with an `id` may be accessed globally using {@link Ext#getCmp Ext.getCmp}.
*
* id should be composed of only alphanumeric characters, dashes, and underscores.
* Characters outside of (a-zA-Z0-9_-) have the potential to cause parsing errors.
*
* Instead of using assigned ids, use the {@link
没有合适的资源?快使用搜索试试~ 我知道了~
ExtJS-4.2.6-src-926个类源码
共520个文件
js:520个
需积分: 9 27 下载量 16 浏览量
2017-02-02
18:43:47
上传
评论
收藏 1.9MB RAR 举报
温馨提示
Ext JS 4.2.6.1811 Release Date: October 5, 2016 Version Number: 4.2.6.1811 ext-src class 926
资源推荐
资源详情
资源评论
收起资源包目录
ExtJS-4.2.6-src-926个类源码 (520个子文件)
AbstractComponent.js 158KB
Store.js 132KB
Tool.js 95KB
Table.js 95KB
Panel.js 94KB
NodeInterface.js 84KB
Model.js 82KB
Date.js 69KB
ContextItem.js 67KB
Element.js 67KB
ClassManager.js 64KB
ComboBox.js 63KB
Dock.js 62KB
Component.js 59KB
Loader.js 56KB
HtmlEditor.js 56KB
Observable.js 55KB
EventManager.js 55KB
Table.js 53KB
Ext-more.js 53KB
Box.js 51KB
Button.js 51KB
Draw.js 49KB
AbstractView.js 49KB
Bar.js 49KB
Lockable.js 48KB
Container.js 48KB
Context.js 48KB
Array.js 47KB
ComponentQuery.js 47KB
Connection.js 47KB
Grouping.js 47KB
Column.js 46KB
Query.js 46KB
Auto.js 45KB
Base.js 44KB
Basic.js 44KB
Renderable.js 44KB
Pie.js 44KB
AbstractContainer.js 43KB
BufferedRenderer.js 43KB
AbstractStore.js 43KB
DragDropManager.js 42KB
Line.js 41KB
Positionable.js 41KB
AbstractMixedCollection.js 41KB
Chart.js 40KB
Date.js 39KB
Model.js 38KB
Axis.js 37KB
Element_anim.js 37KB
Element_style.js 36KB
Reader.js 35KB
Labelable.js 35KB
AbstractElement_style.js 35KB
DragDrop.js 35KB
Support.js 34KB
MessageBox.js 34KB
Border.js 34KB
RowEditor.js 33KB
Controller.js 33KB
TreeStore.js 32KB
Ext.js 32KB
Window.js 31KB
Base.js 31KB
View.js 31KB
View.js 31KB
Surface.js 30KB
EventObject.js 30KB
AbstractElement.js 30KB
Vml.js 29KB
Text.js 29KB
Version.js 29KB
Multi.js 29KB
Area.js 28KB
Format.js 27KB
Class.js 27KB
CellEditing.js 25KB
ToolTip.js 25KB
Svg.js 24KB
Editing.js 24KB
RemotingProvider.js 24KB
Scatter.js 24KB
Panel.js 24KB
Panel.js 23KB
FocusManager.js 22KB
Item.js 22KB
Form.js 22KB
Element_position.js 22KB
Object.js 22KB
Grid.js 22KB
Header.js 22KB
DragTracker.js 22KB
Action.js 21KB
Paging.js 21KB
ZIndexManager.js 21KB
Field.js 21KB
Trigger.js 20KB
Layout.js 20KB
RowModel.js 20KB
共 520 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
glyygs
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功