- 自定義MessageBox
Ext.MessageBox.show({
title:'提示',
msg:'自定義按鈕',
modal:true,
buttons:Ext.Msg.YESNO
});
- 獲取dom
Ext.get('foo');
- 添加類
addClass('elCss')
- 改變樣式
setStyle({
color: 'red',
background: 'yellow',
font-weight: 'bold'
})
- query 操作
Ext.query("span") //所有的span元素
Ext.query("span", "foo"); //父元素爲‘foo’的span
Ext.query("#foo");
Ext.query(".foo");
Ext.query("*");
Ext.query("div p"); 查詢p:被包含在div下
Ext.query("*[class]");
Ext.query("*[class=bar]");
Ext.query("*[class^=b]");
Ext.query("*[class$=r]");
- 事件監聽
e.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
});
- 通過id獲取組件
getCmp(id)