http://www.extjs.com/learn/Tutorial:Events_Explained
参考样例:
参考样例:
OrgChart = Ext.extend(Ext.Panel, {
initComponent:function() {
// call parent init component
OrgChart.superclass.initComponent.apply(this, arguments);
// add custom events
this.addEvents('assigned', 'dismissed');
}
,assign:function(employee, position) {
// do whatever is necessary to assign the employee to position
// fire assigned event
this.fireEvent('assigned', this, employee, position);
}
,dismiss:function(empoyee, position) {
// do whatever is necessary to dismiss employee from position
// fire dismissed event
this.fireEvent('dismissed', this, employee, position);
}
});
本文介绍如何在 ExtJS 中为自定义组件添加并触发事件。通过 OrgChart 组件示例,展示了 addEvents 方法用于定义事件及 fireEvent 方法用于触发事件的具体实现。


被折叠的 条评论
为什么被折叠?



