我为窗体和网格开发 Windows 装饰器。我有一个抽象类:
Ext.define('AM.view.ui.DecoratorAbstract',{
extend: 'Ext.window.Window',
alias: 'widget.decoratorAbstract',
initComponent: function(){
this.resizable = this.cfg[0];
this.closable = this.cfg[1];
this.minimizable = this.cfg[2];
//this.items = this.anItem;
this.callParent(arguments);
}
});
一个子类,没有包含网格的按钮,这很好用:
Ext.define('AM.view.ui.DecoratorGrid',{
extend: 'AM.view.ui.DecoratorAbstract',
alias: 'widget.decoratorGrid',
initComponent: function(){
this.callParent(arguments);
}
});
最后,对于表单,有两个按钮:
Ext.define('AM.view.ui.DecoratorForm',{
extend: 'AM.view.ui.DecoratorAbstract',
alias: 'widget.decoratorForm',
initComponent: function(){
this.buttons = [
{ text:'Guardar', action:'save', iconCls: 'ico-save' },
{ text:'Cancelar', action:'cancel', iconCls: 'ico-cancel' }
];
this.callParent(arguments);
}
});
问题是,显示的按钮不是保护/取消。窗口显示主工具栏程序的按钮。
一个图像:
有任何想法吗 ?。
注意:工具栏是在 app.js 中创建的。Windows,在 Firebug 中进行测试:
Ext.create('AM.view.ui.DecoratorForm',{cfg:[true,true,true]}).show();