是否可以删除或隐藏Sencha中消息框的OK按钮?如果是,我该怎么做?如果不是,原因是什么?在Sencha论坛中,我读到了这个:How to hide or remove "OK" button of a Dialog,但想了解更多细节。
答案 0 :(得分:1)
我试过这种方式,它对我有用。也许它对你有用。我保持
hidden: true
按钮标签中的。
Ext.Msg.show({
title: 'Rate it',
buttons: [{
hidden: true,}]
});
或者您可以尝试这种方式:
Ext.Msg.show({
title: 'Title',
message: 'Some text goes here...',
itemId : 'showMsg',
buttons : []
});
上面提到的两种方式都可以隐藏按钮。当我在冲浪时,我得到了这两个链接hide message box when clicked on screen和tapping message box to hide message box。 思想可能对你有所帮助。
答案 1 :(得分:0)
只是一个想法......如果没有确定按钮,你会如何关闭消息框? :)
使用模态面板怎么样:
Ext.define('Myapp.ModalPanel', {
extend: 'Ext.Panel',
xtype: 'modal-panel',
config: {
height: '50%',
width: '50%',
centered: true,
modal: true,
hideOnMaskTap: true
}
});
然后:
Ext.Viewport.add({
xtype: 'modal-panel',
items: [
{html: 'message'}
]
});