原文在这:http://www.cnblogs.com/taihom/archive/2009/05/16/1458497.html
var tchItem = Ext.create('Ext.panel.Panel', {
id:'teacher',
title:'测试',
cls:'',
items:[
{
xtype:'button',
text:'测试',
width:200,
listeners: {
click:function (){alert('test');}
}
}
],
listeners : {
beforerender : function (){alert('beforerender');},
beforecollapse : function(){alert('beforecollapse');},
beforeexpand : function(){alert('beforeexpand');},
expand : function(){alert('expand');}
}
});
ExtJS 4.0!
核心部分:
listeners : {
beforerender : function (){alert('beforerender');},
beforecollapse : function(){alert('beforecollapse');},
beforeexpand : function(){alert('beforeexpand');},
expand : function(){alert('expand');}
}