我有以下代码
var menus = Ext.air.SystemMenu;
menus.add('File', [
actions.newTask,
actions.newList,
actions.newFolder,
'-',{
text:'Import...',
handler: function(){
var importer = new tx.Importer();
importer.doImport(function(){
tx.data.lists.load();
root.reload();
loadList('root');
Ext.Msg.hide();
});
}
},{
text:'Export...',
handler: function(){
new tx.Exporter();
}
},
'-',
actions.quit
]);并且我想隐藏“导入”项。我已经使用过3.3.0版本的应用编程接口,但是Ext.air.SystemMenu class.How没有隐藏方法,我应该隐藏它吗?
发布于 2011-02-16 20:13:47
给你的导入菜单按钮一个ID:
{
text:'Import...',
id: 'importBtn',
handler: function(){
var importer = new tx.Importer();
importer.doImport(function(){
tx.data.lists.load();
root.reload();
loadList('root');
Ext.Msg.hide();
});
}
}在源代码中有一个可见性的方法(它只是禁用按钮):
setVisible : function(v){
// could not find way to hide in air so disable?
nativeItem.enabled = !v;
},所以你只需要在按钮上调用这个方法:
Ext.getCmp('importBtn').setVisible(false);看起来它并没有提供一个完全隐藏它的方法,因为setVisible方法只是禁用它。
https://stackoverflow.com/questions/5014513
复制相似问题