Ext.MessageBox.show()不显示消息

时间:2012-07-09 09:29:40

标签: extjs sencha-touch-2

我正在从书中学习Sencha Touch。以下示例对我不起作用:

Ext.require('Ext.data.Store');
Ext.require('Ext.dataview.List');
Ext.require('Ext.MessageBox');
new Ext.application({
  name: 'TouchStart',
  launch: function() {
    this.viewport = new Ext.Panel ({
      fullscreen: true,
      items: [{
        docked: 'top',
        xtype: 'toolbar',
        ui: 'light',
        items: [{
          text: 'Panic',
          handler: function(){
            Ext.Msg.alert('Don\'t Panic!','Keep calm');
          }
        },
        {
          text:'Greetings',
          handler: function() {
            Ext.Msg.prompt('Greetings!','What is your name?',
            function (btn,text){
              var response = new Ext.MessageBox().show({
                title: 'Howdy',
                msg: 'Pleased to meet you ' + text,
              });
            });
          }
        }]
      }]
    });
  }
});

特别是:

new Ext.MessageBox().show({
  title: 'Howdy',
  msg: 'Pleased to meet you ' + text,
});

当我运行它时,只显示标题,不会显示任何消息:

problem

任何人都知道为什么会这样?

1 个答案:

答案 0 :(得分:5)

试试这个:

new Ext.MessageBox().show({
   title: 'Howdy',
   message: 'Pleased to meet you ' + text,
});