sencha touch 点击一个按钮在界面出现侧边栏menu组件
//更多
after_More_and_more : function(){
if(a == 0){
if(permissions === '维保人员'){
var menu = Ext.create('Ext.Menu',{
items: [{
xtype: 'button',
text: '保存',
id : 'after_btn_save',
handler: function() {
Ext.Viewport.hideMenu('right');
a=0;
}
}, {
xtype: 'button',
text: '提交',
id : 'after_btn_submit',
handler: function() {
Ext.Viewport.hideMenu('right');
a=0;
}
}],
});
}else{
var menu = Ext.create('Ext.Menu',{
items: [{
xtype: 'button',
text: '保存',
id : 'after_btn_save',
handler: function() {
Ext.Viewport.hideMenu('right');
a=0;
}
}, {
xtype: 'button',
text: '提交',
id : 'after_btn_submit',
handler: function() {
Ext.Viewport.hideMenu('right');
a=0;
}
}, {
xtype: 'button',
text: '批准',
id : 'after_btn_approval',
handler: function() {
Ext.Viewport.hideMenu('right');
a=0;
}
},{
xtype : 'button',
text : '驳回',
id : 'after_btn_rejected',
handler : function(){
Ext.Viewport.hideMenu('right');
a=0;
}
}],
});
}
Ext.Viewport.setMenu(menu,{
side : 'right',
cover : false,
});
Ext.Viewport.showMenu('right');
Ext.getCmp('ladder_task_view').element.on({
tap : function() {
Ext.Viewport.hideMenu('right');
a = 0 ;
},
});
return ;
}
},
这个是在界面的右边拓展,所以是right,showMenu函数是打开Menu组件,然后hideMenu函数是关闭Menu组件,setMenu是设置一些属性。