我用 ExtJS 4.0 试了一下下面的代码,但是按钮却不显示,请问是为什么?<html>
<head><link rel = "stylesheet" type = "text/css"
 href="resources/css/ext-all.css"/>
<script src="ext-all.js"></script><script>
Ext.onReady( function(){
 Ext.Msg.show({
  title: 'Milton',
  msg: "Have you seen my stapler?",
  buttons: {
  yes: true,
  no: true,
  cancel: true
  }
 }
 );
} )</script>
</head>
</html>

解决方案 »

  1.   

    Ext4.0 引入的文件不是这些。
      

  2.   

    看看官方实例
    只需引入一个css文件和一个js文件
      

  3.   

    我就是只引入了一个 css 文件和一个 js 文件
      

  4.   

    兄弟,少了一个text的属性,应该这样写:buttons : [{
    text : '保存',
    handler : function() {
    alert()
    }
    }, {
    text : '取消',
    handler : function() {
    alert()
    }
    }]
      

  5.   

    把代码该成下面这样,在 Firefox 4.0.1 里面还是不显示 buttons:<html>
    <head><link rel = "stylesheet" type = "text/css"
     href="resources/css/ext-all.css"/>
    <script src="bootstrap.js"></script><script>
    Ext.onReady( function(){
     Ext.Msg.show({
         title: 'Milton',
         msg: "Have you seen my stapler?",
         buttons: [{
             text: 'yes'
         }, {
          text: 'no'
         },
         {
          text: 'cancel'
     }]
     }
     );
    } );</script>
    </head>
    </html>
      

  6.   


    是的,在Firefox 4.0.1浏览器下Extjs的代码效果是不显示的,这是正常的,兄弟用IE吧,我们公司基本上不用Firefox,用火狐EXTJS就没效果了!
      

  7.   

    我昨天用 ExtJS 2 试了一下,在 IE 和 Firefox 下面都是可以的,而且 Firefox 的显示效果比 IE 还要好一些
      

  8.   

    你是在看learning extjs 3.2的吧
    4.0变了 
    Ext.onReady(function () {
                Ext.Msg.show({
                    title: 'milton',
                    msg: 'Have you seen my stapler?',
                    buttons: Ext.Msg.YESNOCANCEL
                });
            });
      

  9.   


    <link rel="stylesheet" type="text/css" href="./ext-4.0.1/resources/css/ext-all.css" />
    <script type="text/javascript" src="./ext-4.0.1/bootstrap.js"></script>
    Ext.onReady(function() {
         Ext.create('Ext.Button', {
        text: 'Click me',
        renderTo: Ext.getBody(),        
        handler: function() {
            alert('You clicked the button!')
        }
    });
    });