Package: | Ext |
Class: | SplitBar |
Extends: | Observable |
Defined In: | SplitBar.js |
var split = new Ext.SplitBar("elementToDrag", "elementToSize",
Ext.SplitBar.HORIZONTAL, Ext.SplitBar.LEFT);
split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter("container"));
split.minSize = 100;
split.maxSize = 600;
split.animate = true;
split.on('moved', splitterMoved);
属性 | 定义对象 | |
---|---|---|
animate : Boolean | SplitBar | |
Whether to animate the transition to the new size | ||
maxSize : Number | SplitBar | |
The maximum size of the resizing element. (Defaults to 2000) | ||
minSize : Number | SplitBar | |
The minimum size of the resizing element. (Defaults to 0) | ||
useShim : Boolean | SplitBar | |
Whether to create a transparent shim that overlays the page when dragging, enables dragging across iframes. |
方法 | 定义对象 | |
---|---|---|
SplitBar(String/HTMLElement/Element dragElement , String/HTMLElement/Element resizingElement , [Number orientation ], [Number placement ]) |
SplitBar | |
Create a new SplitBar | ||
addEvents(Object object ) : void |
Observable | |
将对象中没有的事件从给出的对象中复制过来。 | ||
addListener(String eventName , Function handler , [Object scope ], [Object options ]) : void |
Observable | |
为该组件加入事件处理器函数 | ||
destroy(Boolean removeEl ) : void |
SplitBar | |
Destroy this splitbar. | ||
fireEvent(String eventName , Object... args ) : Boolean |
Observable | |
触发指定的事件, 并将参数传入(至少要有事件名称)。 | ||
getAdapter() : The | SplitBar | |
Get the adapter this SplitBar uses | ||
getMaximumSize() : Number | SplitBar | |
Gets the maximum size for the resizing element | ||
getMinimumSize() : Number | SplitBar | |
Gets the minimum size for the resizing element | ||
hasListener(String eventName ) : Boolean |
Observable | |
检查该对象是否拥有指定事件的侦听器 | ||
on(String eventName , Function handler , [Object options ]) : void |
Observable | |
为该组件加入事件处理器函数, addListener 的简写方式 | ||
purgeListeners() : void | Observable | |
从对象身上移除所有的侦听器 | ||
removeListener(String eventName , Function handler , [Object scope ]) : void |
Observable | |
移除侦听器 | ||
setAdapter(Object adapter ) : void |
SplitBar | |
Set the adapter this SplitBar uses | ||
setCurrentSize(Number size ) : void |
SplitBar | |
Sets the initialize size for the resizing element | ||
setMaximumSize(Number maxSize ) : void |
SplitBar | |
Sets the maximum size for the resizing element | ||
setMinimumSize(Number minSize ) : void |
SplitBar | |
Sets the minimum size for the resizing element | ||
un(String eventName , Function handler , [Object scope ]) : void |
Observable | |
移除侦听器, removeListener 的简写方式 |
事件 | 定义对象 | |
---|---|---|
beforeresize : (Ext.SplitBar this ) |
SplitBar | |
Fires before the splitter is dragged | ||
moved : (Ext.SplitBar this , Number newSize ) |
SplitBar | |
Fires when the splitter is moved | ||
resize : (Ext.SplitBar this , Number newSize ) |
SplitBar | |
Fires when the splitter is moved (alias for moved) |
public Boolean animate
public Number maxSize
public Number minSize
public Boolean useShim
public function SplitBar(String/HTMLElement/Element dragElement
, String/HTMLElement/Element resizingElement
, [Number orientation
], [Number placement
])
dragElement
: String/HTMLElement/ElementresizingElement
: String/HTMLElement/Elementorientation
: Numberplacement
: Numberpublic function addEvents(Object object
)
object
: Objectvoid
public function addListener(String eventName
, Function handler
, [Object scope
], [Object options
])
eventName
: Stringhandler
: Functionscope
: Objectoptions
: Object
组合选项
使用选项参数可以组合不同类型的监听器:
下面是一个标准的、延迟执行的、一次性的监听器,将会自动停止事件并传递一个自定义的参数(forumId)
el.on('click', this.onClick, this, { single: true, delay: 100, stopEvent : true, forumId: 4 });
这个方法也允许传递的单个参数是一个包含多个指定处理函数的设置对象。
一次调用多个处理函数
代码:
el.on({ 'click' : { fn: this.onClick scope: this, delay: 100 }, 'mouseover' : { fn: this.onMouseOver scope: this }, 'mouseout' : { fn: this.onMouseOut scope: this } });
或者简写为:
代码:
el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut scope: this });
void
public function destroy(Boolean removeEl
)
removeEl
: Booleanvoid
public function fireEvent(String eventName
, Object... args
)
eventName
: Stringargs
: Object...Boolean
public function getAdapter()
The
public function getMaximumSize()
Number
public function getMinimumSize()
Number
public function hasListener(String eventName
)
eventName
: StringBoolean
public function on(String eventName
, Function handler
, [Object options
])
eventName
: Stringhandler
: Functionoptions
: Objectvoid
public function purgeListeners()
void
public function removeListener(String eventName
, Function handler
, [Object scope
])
eventName
: Stringhandler
: Functionscope
: Objectvoid
public function setAdapter(Object adapter
)
adapter
: Objectvoid
public function setCurrentSize(Number size
)
size
: Numbervoid
public function setMaximumSize(Number maxSize
)
maxSize
: Numbervoid
public function setMinimumSize(Number minSize
)
minSize
: Numbervoid
public function un(String eventName
, Function handler
, [Object scope
])
eventName
: Stringhandler
: Functionscope
: Objectvoid
public event beforeresize
this
: Ext.SplitBarpublic event moved
this
: Ext.SplitBarnewSize
: Numberpublic event resize
this
: Ext.SplitBarnewSize
: Number