我正在使用sencha touch 2 PR1。當我點擊警報按鈕時,打開的警報框沒有「確定」按鈕,其高度覆蓋整個頁面。 這裏是我的看法'確定'按鈕不顯示在Ext.Msg.alert
Ext.define('MyTask.view.Main', {
extend: 'Ext.Container',
alias: 'widget.main',
config: {
items: [
{
xtype : 'button',
cls : 'demobtn',
ui : 'round',
margin: '10 0',
text: 'Alert',
handler: function() {
Ext.Viewport.add(Ext.Msg);
Ext.Msg.alert('Title', 'The quick brown fox jumped over the lazy dog.', Ext.emptyFn);
}
}
]
}
});
和控制器
Ext.define('MyTask.controller.TestController', {
extend: 'Ext.app.Controller',
views: ['Main'],
refs: [
{
ref : 'main',
selector: 'main',
autoCreate: true,
xtype : 'main'
},
],
init: function() {
mainPanel=this.getMain();
Ext.Viewport.add(mainPanel);
}
});
和app.js
Ext.Loader.setConfig({ enabled: true });
Ext.require([
'Ext.XTemplate',
'Ext.Panel',
'Ext.Button',
'Ext.List',
'Ext.MessageBox'
]);
Ext.application({
name: 'MyTask',
controllers: ['TestController'],
});
爲什麼沒有得到正常顯示呢?我在crome和ipad上測試過。 在此先感謝。
贏了,沒什麼影響。我將它添加到視口中,因爲它給出了必須在視口中添加的警告 – Anagha
它不起作用。 – Khush
Hi @Khush,它在我的應用程序中工作(建立在sencha 1.1.0上)。讓我用sencha 2.0.0來檢查它。我也會編輯我的答案。 – heyjii