English 中文(简体)
在Ext.Msg.alert没有展示Kutton
原标题: OK button is not displayed in Ext.Msg.alert

I am using sencha touch 2 PR1 .when I click on alert button the alert box which gets open does not have Ok button and its height covers entire page. here is my view

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);
            }
        }

    ]
}
 });

and controller

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);

}

});

页: 1

 Ext.Loader.setConfig({ enabled: true });


Ext.require([    
 Ext.XTemplate ,
 Ext.Panel ,
 Ext.Button ,
 Ext.List ,
 Ext.MessageBox 
]);




Ext.application({

name:  MyTask ,   
controllers: [ TestController ],

 });

Why it is not getting displayed properly? I tested on crome and ipad. thanks in advance.

问题回答

为什么要把Ext.Msg添加到观察室。 更换手稿功能如下:

handler: function() {

                Ext.Msg.alert( Title ,  The quick brown fox jumped over the lazy dog. ,     Ext.emptyFn);
            }

参看Ext.Viewport.add(Ext.Msg);

Note : I tested it on Sencha 1.1.0

希望将有助于......

Hey guys below code would help you to solve your problem:-

该守则在sen触及2.0号最后测试。

 Ext.Msg.show({
                 title:  Title ,
                 message:  The quick brown fox jumped over the lazy dog. ,
                 buttons: [{
                             id:  alertCancelBtn ,
                             iconCls:  user ,
                             iconMask: true,
                             text:  Ok ,
                             ui:  round decline 
                           }], // buttons
                 height: 200,
                 width: 150,
                     //   Ext.emptyFn      
  }); // show()

我也谈到同一问题,甚至Sencha Touch版本2.0。

At the first time, I thought it is a bug of Sencha Touch. After spending couple days to research, I ve just found out the root cause of this bug. I ve put an extra tag before the HTML5 <!DOCTYPE html> declaration in my html page. I corrected it by put the HTML5 declaration <!DOCTYPE html> on the very top of my page and it fixed my problem.





相关问题
Windows 7 multitouch capabilities with HTML5

I have a problem: There are HTML5/CSS3 mobile frameworks on the market like Sencha Touch and Phonegap which can use the multi-touch gestures of the iPad/iPhone, Android, etc. That s working fine, I ...

Getting started with Sencha Touch

I m an Ext veteran but have a few rather simple mobile apps i need to create and naturally i m looking at sencha touch. Ting is - most of the examples don t run up in Firefox/Opera. I m happily using ...

Custom icon in TabPanel fails

I m trying to add a custom icon to a TabPanel but when I do that it just shows a dark box with rounded corners. My css looks like this: http://pastebin.org/447682 The code in the url is base64 for ...

Sencha Touch and ExtJS

Sencha Touch looks impressive, and ExtJS looks nice. I am evaluating if I should use ExtJS or SproutCore for an upcoming app. Now that Sencha Touch is in the mix, I wonder if I choose ExtJS, it d be ...

Turning Sencha Touch-based app into a true native iPhone app?

As I understand, Sencha Touch is just a javascript library that lets you create websites that respond to multitouch and other features you find in native iPhone apps. So... Your end result is accessed ...

Is anyone using Sencha Touch for mobile development?

We re evaluating Sencha Touch for mobile development. Has anyone used this yet (I realize that it s still in beta), and if so, what are its strengths / weaknesses? How does it compare to alternatives? ...

热门标签