PDA

View Full Version : [2.2] ???????????



amanoman
9 Mar 2009, 4:23 AM
??????
????????on?????addListener??????????????????????????????remove???????????????????????????????????????????????

???????


<html>
<head>
<title>???????</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css"/>

<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<!-- ENDLIBS -->
<script type="text/javascript" src="../../ext-all.js"></script>
<!--???????-->
<script type="text/javascript">
Ext.onReady(function() {
//???????????
var addCenterPanel=function() {
var panel=new Ext.Panel({title:'???',width:100,height:100,html:'??????'});
var center=Ext.getCmp('center');
center.add(panel);
center.doLayout();
//??????????????
panel.el.on('click',function() {alert('??????')});
}
//?????????????
var removeCenterPanel=function() {
var center=Ext.getCmp('center');
if (center.items.length) {
center.removeAll();
center.doLayout();
}
}
var layout=new Ext.Viewport({
title:'???????',
layout:'border',
items:[
{
region:'west',
width:150,
items:[
new Ext.Button({
text:'?????',
handler:addCenterPanel
}),
new Ext.Button({
text:'???',
handler:removeCenterPanel
})
]
},
{
xtype:'panel',
id:'center',
region:'center',
title:'???????'
}
]
});
layout.render(document.body);

});
</script>
</head>
<body>

</body>
</html>

yuki
9 Mar 2009, 6:38 AM
??????
????????on?????addListener??????????????????????????????remove???????????????????????????????????????????????


Ext.Component???????????Container??remove/removeAll?????????????destroy????????autoDestroy?????false??????????????????????????????????????????Container?items?????????????????????????????????????????????????????

?????????????????????????????????????????????????????????????????????????IE????????????????????????2.2.1?????????????????????????????????


"element orphan" in a "one page one application" web page (http://extjs.com/forum/showthread.php?t=45782)????
Hope for the IE Orphanage (http://extjs.com/forum/showthread.php?t=50400)????


3.0???????????????????????????????:)

amanoman
9 Mar 2009, 9:01 AM
yuki??
????????????
?????????????????(?????)
????????on???listener?????panel.el.on()????????????????????????????
(?? ????????????us???????????????:-?)

yuki
9 Mar 2009, 2:52 PM
yuki??
????????on???listener?????panel.el.on()????????????????????????????

panel.el??????????????????.el????????????????????????????????????????click??focus??????????????????destroy??????????????????

Ext.Component.destroy

destroy : function(){
if(this.fireEvent("beforedestroy", this) !== false){
this.beforeDestroy();
if(this.rendered){
this.el.removeAllListeners();
this.el.remove();
if(this.actionMode == "container"){
this.container.remove();
}
}
this.onDestroy();
Ext.ComponentMgr.unregister(this);
this.fireEvent("destroy", this);
this.purgeListeners();
}
},



(?? ????????????us???????????????:-?)

?????????????????????????????????????????????????????????;)

amanoman
9 Mar 2009, 3:28 PM
yuki??
??????????
?????????????????????????
IE?memory leak?????Ext 3.0???????
??????IE??????:-?)


?????????????????????????????????????????????????????????

???????????????????:))